| 30 | }; |
| 31 | |
| 32 | class App extends React.Component { |
| 33 | constructor(props) { |
| 34 | super(props); |
| 35 | |
| 36 | this.state = { value: Store.get() }; |
| 37 | Store.subscribe(value => this.setState({ value })); |
| 38 | } |
| 39 | render() { |
| 40 | return ( |
| 41 | <div> |
| 42 | <Switcher |
| 43 | value={ this.state.value } |
| 44 | onChange={ Store.set.bind(Store) } /> |
| 45 | </div> |
| 46 | ); |
| 47 | } |
| 48 | }; |
| 49 | |
| 50 | ReactDOM.render(<App />, document.querySelector('#container')); |
nothing calls this directly
no outgoing calls
no test coverage detected