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

.updates(): allow a handler to return null or false to prevent a state update #55

Open
couzic opened this issue Dec 14, 2018 · 0 comments

Comments

@couzic
Copy link
Owner

couzic commented Dec 14, 2018

Currently, one can return (state) => state

      searchBeerName: name => name.length > 0
          ? _.focusPath('loading').setValue(true)
          : state => state,

Returning null would look like:

      searchBeerName: name => name.length > 0
          ? _.focusPath('loading').setValue(true)
          : null,

Returning false would look like:

      searchBeerName: name => name.length > 0 && _.focusPath('loading').setValue(true)
@couzic couzic changed the title .updates(): allow a handler to return null to prevent a state update .updates(): allow a handler to return null or false to prevent a state update Dec 14, 2018
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

No branches or pull requests

1 participant