javascript - RxJS - Emit value after ever n received -
does there exist operator enables emissions throttled count?
i want repeat skip call. in example below skip 5, emit value , repeat.
export default function errorhandler(action$){ action$.oftype(types.error) /* after every n emissions received, emit once */ .map(someaction) }
you use buffercount
, emit once has buffered specified number of actions.
with rxjs's terminology, throttling involve first of buffered actions being emitted:
export default function errorhandler(action$){ action$.oftype(types.error) .buffercount(5) .map((actions) => actions[0]); }
emitting last buffered action instead referred debouncing, in rxjs's terminology:
export default function errorhandler(action$){ action$.oftype(types.error) .buffercount(5) .map((actions) => actions[actions.length - 1]); }
Comments
Post a Comment