import type { Fn } from "@thi.ng/api" ; import { NO_OP } from "@thi.ng/api/api" ; import type { IReducible , Reducer , TxLike } from "./api.js" ; import { transduce } from "./transduce.js" ; const NO_OP_REDUCER = [ NO_OP , NO_OP , NO_OP ] ; /**
 * Transforms `xs` with given transducer and optional side effect
 * without any reduction step. If `fx` is given it will be called with
 * every value produced by the transducer. If `fx` is *not* given, the
 * transducer is assumed to include at least one  sideEffect step
 * itself. Returns nothing.
 *
 *  param tx param fx param xs export function run < A > ( tx , xs ) ; export function run < A > ( tx , xs ) ; export function run < A , B > ( tx , fx , xs ) ; export function run < A , B > ( tx , fx , xs ) ; export function run < A , B > ( tx , ... args ) { if ( args . length === 1 ) { transduce ( tx , NO_OP_REDUCER , args [ 0 ] ) ; } else { const fx = args [ 0 ] ; transduce ( tx , [ NO_OP , NO_OP , ( _ , x ) => fx ( x ) ] , args [ 1 ] ) ; } }