Skip to content

Use form.getState() directly instead of using subscriptions.#16

Open
BowlingX wants to merge 1 commit intofinal-form:masterfrom
freshcells:master
Open

Use form.getState() directly instead of using subscriptions.#16
BowlingX wants to merge 1 commit intofinal-form:masterfrom
freshcells:master

Conversation

@BowlingX
Copy link
Copy Markdown

Hi :),

I was running into timing issues on async error handling (with final-form 4.18.6 and react-final-form 6.3.3). (The promise in onSubmit would resolve before / at the same time the subscription callback fires and would compare against a stale state. I'm not sure why the subscription is needed because we have access to the form state directly with getState().

This pull request adresses the issue of a potential stale state.

@codecov
Copy link
Copy Markdown

codecov bot commented Nov 27, 2019

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (c26b46e) to head (56dee29).
⚠️ Report is 7 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master       #16   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            5         5           
  Lines           44        40    -4     
  Branches        11        11           
=========================================
- Hits            44        40    -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@BowlingX
Copy link
Copy Markdown
Author

Any more information required to have this merged? :)

@TylerRick
Copy link
Copy Markdown

I like how this simplifies things. Any reason we shouldn't merge this, @erikras?

@mishaberezin
Copy link
Copy Markdown

@erikras Could you please give some feedback on this issue. We're having the same problem in our projects and have to use fork of this library with similar patch applied.

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