timeout-flow
Version:
Fluent, composable, pauseable JavaScript timers and time control flows — plus RAF utilities for frame-based logic.
12 lines (11 loc) • 372 B
TypeScript
/**
* Resolves flexible (fn, delay) or (delay, fn) inputs.
*
* @param {Function|string|number} a - function or duration
* @param {Function|string|number} b - function or duration
* @returns {{ fn: Function, delay: number }}
*/
export function resolveDelayAndFn(a: Function | string | number, b: Function | string | number): {
fn: Function;
delay: number;
};