1.1.0 • Published 7 years ago

lux-state v1.1.0

Weekly downloads
9
License
-
Repository
-
Last release
7 years ago

State management.

In your HOC:

import {connector} from 'lux-state'

mapStateToProps = state = ({
  someValue: state.someValue,
  anotherValue: state.anotherValue,
})

mapDispatchToProps = dispatch => ({
  someAction: () => dispatch(actionFunc())
})

export default connect(
  mapStateToProps,
  mapDispatchToProps,
)(YourHOC)
in your `src/index`:

import { createStore } from './lib/store';
// can also import middleware here

const store = createStore(reducer, applyMiddleware(
  loggingMiddleware,
  thunkMiddleware,
));

ReactDOM.render(
  <Provider store={store}>
    <App />
  </Provider>,
  document.getElementById('root'),
);

heavily influenced by Zapier engineering

1.1.0

7 years ago

0.1.0

7 years ago