Skip to content
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

Merged
merged 10 commits into from
Sep 27, 2020
Merged

feat(core): form schema creator #8

merged 10 commits into from
Sep 27, 2020

Conversation

mixvar
Copy link
Collaborator

@mixvar mixvar commented Sep 24, 2020

resolves #4

  • setup code structure
  • FieldDecoder type
  • FieldDescriptor type
  • FormSchema type
  • type utils
  • decoders implementation: bool, string, number, choice, instanceOf, array
  • createFormSchema implementation

see .spec files for details

@mixvar mixvar requested a review from pidkopajo September 24, 2020 23:36
src/core/builders/create-form-schema.ts Outdated Show resolved Hide resolved
src/core/decoders/choice.ts Outdated Show resolved Hide resolved
* }));
* ```
*/
export const string = (): FieldDecoder<string> => {
Copy link
Collaborator

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.

Copy link
Collaborator Author

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

@pidkopajo pidkopajo added the VB label Sep 27, 2020
- change array path format
- choice decoder: better signature
- choice decoder: remvoe runtime input assertion
- choice decoder: more performant implementation
@mixvar mixvar merged commit 8394379 into master Sep 27, 2020
@mixvar mixvar deleted the feat/form-schema-creator branch September 27, 2020 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[core] schema creator implementation
2 participants