Skip to content

Instantly share code, notes, and snippets.

@NetanelBasal
Last active October 30, 2022 13:49
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save NetanelBasal/8baac19de444c51776c6b7cf191aa49b to your computer and use it in GitHub Desktop.
import { repeat, filter, take } from 'rxjs';
@Injectable({ providedIn: 'root' })
export class FooService {
private http = inject(HttpClient);
doSometing(data) {
return this.http.post('https://foo', data)
.pipe(
repeat({ delay: 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