You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Proposal: allowing the entire state param to be either an object or a function could simplify the above two features, and result in fewer function calls when initializing the state.
E.g.
// state as plain object
@ui({state: {uiVar1: 'this',uiVar2: 'that'}})// state as function
@ui({state: (props,state)=>({uiVar1: 'this',uiVar2: state.router.location.query.searchTerm})})// state as function returning Immutable.js collection
@ui({state: (props,state)=>Immutable.Map({uiVar1: 'this',uiVar2: state.router.location.query.searchTerm})})
Any issues/cases I'm not covering here?
If you're interested in this extension to the API, I'd be happy to submit a PR.
The text was updated successfully, but these errors were encountered:
Currently, state object type (POJO or Immutable.js collection or whathaveyou) can be configured by passing a third argument to the reducer function
And keys in the ui state tree can be either keys or functions in order that they can be initialized based on component props.
Proposal: allowing the entire state param to be either an object or a function could simplify the above two features, and result in fewer function calls when initializing the state.
E.g.
Any issues/cases I'm not covering here?
If you're interested in this extension to the API, I'd be happy to submit a PR.
The text was updated successfully, but these errors were encountered: