react-warp-core
Version:
Yummy React extras
21 lines (16 loc) • 376 B
JavaScript
import './Clock.scss';
export default class Clock extends Component {
time;
async start(){
this.runClock = true;
while(this.runClock){
console.log('well')
this.time = new Date()
.toLocaleTimeString('en-US',{hour12: false});
await sleep(1000);
}
}
componentWillUnmount(){
this.runClock = false;
}
}