-
Notifications
You must be signed in to change notification settings - Fork 0
Repeat With Delay
Ivan Kasenkov edited this page Dec 22, 2021
·
4 revisions
https://codesandbox.io/s/ksrepeatwithdelay-7khd5
ksRepeatWithDelay.ts
import { ksDelay, ksRepeatWhen, Transformer } from '@keiii/k-stream';
/**
* Perform some action regularly with specific delay between.
*/
export const ksRepeatWithDelay = <A>(ms: number): Transformer<A, A> => {
return stream => stream.pipe(ksRepeatWhen(x => x.pipe(ksDelay(ms))));
};