Skip to content

Commit

Permalink
docs: remove already implemented features
Browse files Browse the repository at this point in the history
  • Loading branch information
YannicEl committed Dec 30, 2023
1 parent e74fd99 commit 7b5f22c
Showing 1 changed file with 0 additions and 56 deletions.
56 changes: 0 additions & 56 deletions packages/docs/feature-ideas.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,59 +17,3 @@ Stuff I'm thinking about but haven't implemented yet.
},
});
```

- **Form wide validators**

Make it possible to add validators to the entire form. Maybe with this syntax:

```ts
import { useForm } from '@vuetils/form';

const form = useForm(
{
hallo: [''],
zwallo: [0],
drallo: [false],
},
{
validators: [],
asyncValidators: [],
}
);
```

- **Zod and Valibot form wide validators**

When form wide validators are implemented a zod validator could look something like this:

```ts
import { Schema, z } from 'zod';

const zodValidator = defineValidatorWithArgs('zod', (value, schema: Schema) => {
try {
schema.parse(value);
return true;
} catch {
return false;
}
});

const schema = z
.object({
hallo: z.string(),
zwallo: z.number(),
drallo: z.boolean(),
})
.strict();

const form = useForm(
{
hallo: [''],
zwallo: [''],
drallo: [''],
},
{
validators: [zodValidator(schema)],
}
);
```

0 comments on commit 7b5f22c

Please sign in to comment.