Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iamkhan21/fxform
Reactive forms based on effector and zod
https://github.com/iamkhan21/fxform
Last synced: about 1 month ago
JSON representation
Reactive forms based on effector and zod
- Host: GitHub
- URL: https://github.com/iamkhan21/fxform
- Owner: iamkhan21
- License: mit
- Created: 2022-11-13T14:37:55.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2022-12-22T07:16:53.000Z (about 2 years ago)
- Last Synced: 2023-12-26T11:23:00.085Z (12 months ago)
- Language: TypeScript
- Size: 84 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# @iamkhan21/fxform [![NPM version](https://img.shields.io/npm/v/@iamkhan21/fxform?color=a1b858&label=)](https://www.npmjs.com/package/@iamkhan21/fxform)
Reactive forms based on effector and zod
## Usage example
```ts
import { z, ZodLiteral, type ZodNumber, type ZodString } from "zod";
import { createForm } from "@iamkhan21/fxform";/**
* email: ["", z.string().trim().email()] as [string, ZodString]
* email - Name of field
* '' - initial value
* z.string().trim().email() - zod validation scheme
*/
const formData = {
email: ["", z.string().trim().email()] as [string, ZodString],
age: [null, z.number().gte(18)] as [number | null, ZodNumber],
agreeWithRules: [false, z.literal(true)] as [boolean, ZodLiteral],
};const form = createForm(formData);
```## License
[MIT](./LICENSE) License © 2022 [Ivan Khanevich](https://github.com/iamkhan21)