Yoshi20 / IoT-Rex

0 stars 0 forks source link

~alle 10s eventsGet() aufrufen #26

Closed Yoshi20 closed 4 years ago

Yoshi20 commented 4 years ago

componentDidMount() -> timer starten analog:

intervalID = 0;

pollVariable = () => { this.intervalID = setTimeout(() => { if (this.props.isActive) { this.props.loadVariable(this.props.variableName); this.pollVariable(); } }, 1000); };

componentWillUnmount() { clearInterval(this.intervalID); }