Created
March 11, 2021 21:32
-
-
Save ssougnez/e5f6f40ccb3a1199bef03f37cae8918b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { interval } from 'rxjs'; | |
import { mergeMap, takeUntil } from 'rxjs/operators'; | |
interval(1000) | |
.pipe( | |
takeUntil(this.destroy$), | |
mergeMap(() => this._http.put('http://localhost:3000/documents/1', { lastUpdate: new Date() })) | |
) | |
.subscribe(x => console.log('Document saved!')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment