Skip to content

Instantly share code, notes, and snippets.

@Jared-Dahlke
Created September 26, 2019 07:23
Show Gist options
  • Select an option

  • Save Jared-Dahlke/3830ea703ce46df1ed08b85dc9bb7355 to your computer and use it in GitHub Desktop.

Select an option

Save Jared-Dahlke/3830ea703ce46df1ed08b85dc9bb7355 to your computer and use it in GitHub Desktop.
import store from '../MyStoreAndMore.js'
class SecondScreen extends React.Component {
constructor(props, context) {
super(props, context);
this.state = store.getState();
store.subscribe(()=>{
this.setState(store.getState());
});
}
state={
AlertCount:null
}
componentDidMount(){
this.setState({AlertCount: store.getState().AlertCount})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment