1.0.0 • Published 8 years ago

socrates-container v1.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

socrates-container

npm package

socrates-container is a simple extension to the standard React component class to simplify unwrapping a Socrates-based Redux store in React container components.

npm install -s socrates-container
import SocratesContainer from './SocratesContainer';

import SomeComponent from 'SomeComponent';

class App extends SocratesContainer {

  componentWillMount () {
    super.componentWillMount();
  }

  // { this.props.store } The Socrates store.
  // { this.state.store } The unwrapped Socrates store that updates on subscribe changes.
  render () {
    return (
      <div className = "container-app">
        <SomeComponent store = { this.state.store } />
      </div>
    );
  }
}
1.0.0

8 years ago