An open API service indexing awesome lists of open source software.

https://github.com/secundant/reformed

Forms is business logic
https://github.com/secundant/reformed

dx effector form forms reactive typescript ux validation

Last synced: about 2 months ago
JSON representation

Forms is business logic

Awesome Lists containing this project

README

        

# Reformed

Forms as business logic.

```tsx
import { createHtmlForm } from '@reformed/html';
import { Form, useForm } from '@reformed/react';

const form = createHtmlForm({
fields: {
login: [
'',
{
required: true
}
],
password: [
'',
{
required: true
}
],
comfirmPassword: [
'',
{
required: true
}
]
},
validate: {
on: 'submit',
fn: ({ password, comfirmPassword }) => {
if (password !== comfirmPassword) {
return {
comfirmPassword: 'should be equal to password'
};
}
}
},
submit: {
mapParams: omit(['comfirmPassword']),
fn: submitFx
}
});

sample({
clock: form.submitFailed
});
sample({
clock: form.submitted,
target: HomePage.route.open
});

// ...

function MyForm() {
const { register } = useForm(form);

return (










Login

);
}
```

> WIP

## Credits

Reformed inspired by ...