Last active
October 30, 2022 13:49
-
-
Save NetanelBasal/ac7f6e3e6fe6ce935e72aade00f6a0f5 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 { repeat, filter, take, timer } from 'rxjs'; | |
@Injectable({ providedIn: 'root' }) | |
export class FooService { | |
private http = inject(HttpClient); | |
doSometing(data) { | |
return this.http.post('https://foo', data) | |
.pipe( | |
// πππ | |
repeat({ delay: (count) => timer(count * 1000) }), | |
filter((res) => res.status === 'completed'), | |
take(1) | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment