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

[RFR][v3] FormDataConsumer - add subscription prop to the FormDataConsumer #3670

Merged
merged 1 commit into from
Sep 13, 2019
Merged

Conversation

natrim
Copy link
Contributor

@natrim natrim commented Sep 11, 2019

by default subscribe's to all changes like it is now
but user could change it by passing the subscription prop

@djhi
Copy link
Collaborator

djhi commented Sep 11, 2019

Did you notice any performance issues ? Did you measure this change actually improve performances ?

@djhi djhi added this to the 3.0.0 milestone Sep 11, 2019
@natrim
Copy link
Contributor Author

natrim commented Sep 11, 2019

i have big form (80 inputs, iterators, arrayinputs with tables) and get small lags spikes without this if writing to some input fast enough, so the speed up is only ~50ms, so most users will not notice any change

btw. to fully remove the lags i debounced the render of FormDataConsumer with HoC
but i have no idea if someone else would want that

@fzaninotto
Copy link
Member

I think FormDataConsumer should be "works all the time" component for subscribing to the form. For more fined grained subscriptions, I think users should use useFormState or <FormSpy>. So I'm -1 on this one.

@natrim
Copy link
Contributor Author

natrim commented Sep 12, 2019

maybe i could add subscription prop to the FormDataConsumer
it will by default subscribe to all changes like it is now
but user could change it by passing the sub object?

@fzaninotto
Copy link
Member

Good idea!

@natrim
Copy link
Contributor Author

natrim commented Sep 13, 2019

@fzaninotto changed it

@natrim natrim changed the title [RFR][v3] FormDataConsumer - subscribe only to values change [RFR][v3] FormDataConsumer - add subscription prop to the FormDataConsumer Sep 13, 2019
 to pass to the final-form useFormState
@fzaninotto fzaninotto merged commit e5ddaca into marmelab:next Sep 13, 2019
@fzaninotto
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants