Answer the question
In order to leave comments, you need to log in
What happens in this example?
class Timer extends React.Component {
state = {
value: 0
}
subscription = undefined;
componentWillMount() {
this.subscription = Rx.Observable.timer(0, 1000).timestamp().subscribe(::this.setState);
}
componentWillUnmount() {
this.subscription.dispose();
}
render() {
return <div>{ this.state.value }</div>
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question