ngxtension / ngxtension-platform

Utilities for Angular
https://ngxtension.netlify.app/
MIT License
531 stars 77 forks source link

feat: add rxjs operators `poll` and `whenDocumentVisible` #405

Closed FabienDehopre closed 3 weeks ago

FabienDehopre commented 1 month ago

Add two RxJs operators that works well together but still can be used independently.

poll can be used to poll an API at a fixed interval with an optional initial delay. whenDocumentVisible is the RxJs counterpart of the injectDocumentVisibility and can be used to pause and resume a RxJs stream based on the document visibility state.

I already have a PR ready (#404) if you wish to add these 2 new RxJs operators.