-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
Adding support for dynamic update methods. #6
Conversation
Codecov Report
@@ Coverage Diff @@
## master #6 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 1 1
Lines 21 25 +4
Branches 3 4 +1
=====================================
+ Hits 21 25 +4
Continue to review full report at Codecov.
|
src/decorator.js
Outdated
const update = updates[destField] | ||
form.change(destField, update(next, values)) | ||
}) | ||
if (updates instanceof Function) { |
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 think typeof > instanceof
?
Adjusted for using typeof. |
Can you update both |
I updated the readme. Unfortunately, I don't have enough experience with Flowtype to make the adjustment. Can you handle this? |
Hi Erik, I'm unsure - I don't want to put you under any pressure. It would be great, though, you could take over and release a new release. Thank you :) |
I can do it. Just gotta get around to it. 😄 |
Hi all ! how can i get this feature ? |
Published fix in |
This adds the possibility to use the "updates" field as a method for dynamically returning fields to update instead of just allowing a static list. It makes the whole package much for interesting when used in combination with final-form-arrays.
I also added a new test case to cover the new functionality.
Other tests and linting are looking good as well.
Fixed #5