Skip to content

i7an/react-observable-state

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React Observable State

npm install --save react-observable-state

Experimental mixin that gives a simple way to listen for props or state changes.

React.createClass({
  componentDidMount() {
    this.listenState('selectedItem', this.reloadSomeList);
  },
  reloadSomeList() {
    // reload
  },
  render() {
    return (
      <div>
        <CollectionView selectedItem={tis.state.selectedItem}
                        collection={this.state.collection} />
        <CollectionView selectedItem={tis.state.someSelectedItem}
                        collection={this.state.someCollection} />
      </div>
    );
  }
});

About

Listen for state or props field update

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published