Skip to content

Commit

Permalink
feat: added the useResetForm helper
Browse files Browse the repository at this point in the history
  • Loading branch information
logaretm committed Dec 18, 2020
1 parent b88dffd commit 4c57715
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/vee-validate/src/useResetForm.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { inject } from 'vue';
import { FormSymbol } from './symbols';
import { FormState } from './types';

export function useResetForm<TValues = Record<string, any>>() {
const form = inject(FormSymbol);

return function resetForm(state?: Partial<FormState<TValues>>) {
return form?.resetForm(state);
};
}

0 comments on commit 4c57715

Please sign in to comment.