npm.io
0.0.3 • Published 8 years ago

react-with-redux

Licence
ISC
Version
0.0.3
Deps
0
Size
5 kB
Vulns
0
Weekly
0

Use

import WithRedux from 'react-with-redux';
import {pullThings,selectThing} from 'actions';

export default () => (
  <WithRedux onMountDispatch={pullThings}>
    {(state,dispatch)=>(
        state.things.map(t => (
          <a onClick={() => dispatch(selectThing(t.id))}> {t.name} </a>
        ))
    )}
  </WithRedux>
)

Props

onMountDispatch<Function>

An action creator to be dispatched onDidMount