refresh data after some time angular
import { Subscription, timer } from 'rxjs';
import { switchMap } from 'rxjs/operators';
subscription: Subscription;
statusText: string;
ngOnInit() {
this.subscription = timer(0, 10000).pipe(
switchMap(() => this.myservice.checkdata())
).subscribe(result => this.statustext = result);
}
ngOnDestroy() {
this.subscription.unsubscribe();
}
Also in JavaScript:
- embed discord.js
- neo4j create relationship between existing nodes
- javascript json deserialize
- random number generator js
- jquery validator no space
- what is @ atsign in first of file path nodejs
- js toFixed
- simple counter react
- how to create a server in node js
- javascript test for empty object
- react native loading
- pi in js
- regex for number and letters
- how to remove first element of array in javascript
- js reload page 1024 breakpoint
- jquery selector this and class
- send data from form to another page angular
- terser
- javascript is number an integer
- ojs link privacy page
- migratory bird problem in javascript
- displaying the date react
- how to delay something in javascript
- replace all javascript