Skip to content

Instantly share code, notes, and snippets.

@frederickfogerty
Last active August 29, 2015 14:24
Show Gist options
  • Save frederickfogerty/dacc9e8dc1a6d3f113ec to your computer and use it in GitHub Desktop.
Save frederickfogerty/dacc9e8dc1a6d3f113ec to your computer and use it in GitHub Desktop.
Wrapping action creators in dispatch explicitly
import {dispatch} from './redux'
export const myAction = (...args) => dispatch({type: CONSTANT, ...})
...
<div onClick={Actions.myAction()} /> // No this.context.store.dispatch needed
...
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