Emits each value after the callback result resolves, to control/mitigate the processing flow.
The resolved value itself is ignored.
import {pipe, toAsync, tap, throttle} from 'iter-ops';const i = pipe( toAsync([1, 2, 3, 4, 5]), throttle(async (value, index, state) => { await processValue(value); }), tap(value => { // value = 1, 2, 3, 4, 5 (each delayed by processing time) })); Copy
import {pipe, toAsync, tap, throttle} from 'iter-ops';const i = pipe( toAsync([1, 2, 3, 4, 5]), throttle(async (value, index, state) => { await processValue(value); }), tap(value => { // value = 1, 2, 3, 4, 5 (each delayed by processing time) }));
Error: 'Operator "throttle" requires asynchronous pipeline' when used inside a synchronous pipeline.
Error: 'Operator "throttle" requires asynchronous pipeline'
Emits each value after the callback result resolves, to control/mitigate the processing flow.
The resolved value itself is ignored.