0.0.1 • Published 3 years ago

@tkvw/rxjs v0.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

Retry

import { createRetry } from "@tkvw/rxjs";

const {attempt,retry} = createRetry(cancel,m => ({
    ...m,
    message: "additional data"
}));

const subscription = attempt.subscribe(({attempt,error,cancel}) => {
    if(attempt>=10){
        cancel();
    }
});

of(1)
    .pipe(retry)
    .subscribe();