Skip to content
This repository has been archived by the owner on Feb 14, 2023. It is now read-only.

Re-add destructuring of dispatch. #90

Closed
quisido opened this issue Jun 5, 2019 · 0 comments
Closed

Re-add destructuring of dispatch. #90

quisido opened this issue Jun 5, 2019 · 0 comments
Assignees
Labels
feature A new feature is requested.
Milestone

Comments

@quisido
Copy link
Collaborator

quisido commented Jun 5, 2019

React's native useReducer returns [ state, dispatch ].

When using a property reducer, we can return a destructurable dispatch function, such that both of the following are valid:

const dispatch = useDispatch(propertyReducer, 'propertyName');

and

const [ propertyValue, dispatch ] = useDispatch(propertyReducer, 'propertyName');

We want to be sure the Component does not subscribe to state changes in the first case, but does in the second case.

@quisido quisido added the feature A new feature is requested. label Jun 5, 2019
@quisido quisido added this to the 2.1.3 milestone Jun 5, 2019
@quisido quisido self-assigned this Jun 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature A new feature is requested.
Projects
None yet
Development

No branches or pull requests

1 participant