-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(core): form schema creator #8
Conversation
- make surre error at compile time is thrown by TS for empty choice field - throw error at run time too - fix JSDoc not appearing
* })); | ||
* ``` | ||
*/ | ||
export const string = (): FieldDecoder<string> => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a general note, wdyt of adding optional initial
param to decoders? that will put the responsibility of form state initialization(or reset) to decoders only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not convinced this will work - with the currently planned approach decoders and schema need to work in static way - as top level export, while initial values may be dynamic and depend on e.g. component props
- change array path format - choice decoder: better signature - choice decoder: remvoe runtime input assertion - choice decoder: more performant implementation
resolves #4
FieldDecoder
typeFieldDescriptor
typeFormSchema
typebool
,string
,number
,choice
,instanceOf
,array
createFormSchema
implementationsee
.spec
files for details