Skip to content

Instantly share code, notes, and snippets.

@hosseinmd
Last active June 30, 2020 22:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hosseinmd/7c1bacaf1768391c9005d0f8443346c7 to your computer and use it in GitHub Desktop.
Save hosseinmd/7c1bacaf1768391c9005d0f8443346c7 to your computer and use it in GitHub Desktop.
example of react-global-hook actions
const actions = ({ setState, getState }) => {
increase(store) {
const { counter } = getState();
setState({
counter: counter + 1
});
},
decrease(store) {
const { counter } = getState();
setState({
counter: counter - 1
});
}
};
export default actions;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment