-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9629180
commit 3bd6621
Showing
27 changed files
with
409 additions
and
135 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { AllRulesDeclarations, RegleBehaviourOptions } from '../types'; | ||
import { createUseRegleComposable } from './useRegle'; | ||
|
||
/** | ||
* Root function that allows you to define project-wise all your custom validators or overwrite default ones | ||
* | ||
* It will return utility functions that let you build type-safe forms | ||
* | ||
* @param customRules | ||
*/ | ||
export function defineRegleOptions<TCustomRules extends Partial<AllRulesDeclarations>>({ | ||
rules, | ||
options, | ||
}: { | ||
rules?: () => TCustomRules; | ||
options?: RegleBehaviourOptions; | ||
}) { | ||
const useRegle = createUseRegleComposable<TCustomRules>(rules, options); | ||
|
||
return useRegle; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export { createRule, unwrapRuleParameters } from './createRule'; | ||
export * from './useRegle'; | ||
export { defineCustomValidators } from './defineCustomValidators'; | ||
export { useRegle } from './useRegle'; | ||
export { defineRegleOptions } from './defineRegleOptions'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.