import { isIterable } from "@thi.ng/checks/is-iterable" ; import type { Transducer } from "./api.js" ; import { iterator } from "./iterator.js" ; import { partitionBy } from "./partition-by.js" ; remarks Only to be used in async contexts, NOT with  {@link (transduce:1)} * directly.
 *
 * Also see:
 * -  {@link @thi.ng/rstream# | @thi.ng/rstream} * -  {@link @thi.ng/csp# | @thi.ng/csp} .
 *
 *  example param period export function partitionTime < T > ( period ) ; export function partitionTime < T > ( period , src ) ; export function partitionTime < T > ( period , src ? ) { return isIterable ( src ) ? iterator ( partitionTime ( period ) , src ) : partitionBy ( ( ) => { let last = 0 ; return ( ) => { const t = Date . now ( ) ; t - last >= period && ( last = t ) ; return last ; } ; } , true ) ; }