Add ability to generate a record of symbol proxies for large forms #13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this pull request do?
Adds a function
mkSProxies
which allows you to provide a proxy for your form type and receive a record filled with proxies for each of the fields inside. For small forms this won't provide much in the way of savings, but for larger forms it reduces the boilerplate required to create a form and ensures that the proxies stay in sync with the actual fields in the form.Where should the reviewer start?
Review the new class in
Formless.Spec.Transform
and the changes in the examples, especially in Polyform and thereal-world
example.Other Notes:
This does not require any changes to existing code as you are still free to define symbol proxies manually if you'd like. This is more of a preparatory improvement to the library's functionality to try and provide per-field validation & modification than a major feature addition.