lenrix icon indicating copy to clipboard operation
lenrix copied to clipboard

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

Open couzic opened this issue 6 years ago • 0 comments

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 avatar Dec 14 '18 10:12 couzic