Skip to content

Instantly share code, notes, and snippets.

@jpgorman
Last active September 20, 2018 11:36
Show Gist options
  • Save jpgorman/471088ec2147cc692fb7b85cb3b0e0a5 to your computer and use it in GitHub Desktop.
Save jpgorman/471088ec2147cc692fb7b85cb3b0e0a5 to your computer and use it in GitHub Desktop.
// my-module.js
import * as React from 'react'
import {connect} from 'react-redux'
const mapStateToProps = (state) => ({
foo: state['my-module'].foo,
})
const view = connect(mapStateToProps)(({foo}) => <div>{foo}</div>)
const fooReducer = (state = 'Some Stuff') => {
return state
}
const reducers = {
'foo': fooReducer,
}
export default {
name: 'my-module',
view,
reducers,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment