Last active
August 29, 2015 14:24
-
-
Save frederickfogerty/dacc9e8dc1a6d3f113ec to your computer and use it in GitHub Desktop.
Wrapping action creators in dispatch explicitly
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {dispatch} from './redux' | |
export const myAction = (...args) => dispatch({type: CONSTANT, ...}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
<div onClick={Actions.myAction()} /> // No this.context.store.dispatch needed | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let _redux = null; | |
export const get = () => _redux | |
export const set = (redux) => _redux = redux |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment