Namespace Flow

Control execution

Logic-oriented

Rate-oriented

  • debounce: Only handle invocation after a minimum time has elapsed
  • throttle: Only handle invocations at a maximum rate

Time-oriented

  • timeout: Run code after a specified time delay
  • sleep: Using async await, delay execution for a period
  • sleepWhile: Keep sleeping until a predicate returns true
  • delay: Using async await, run a given callback after a period
  • waitFor: Calls a function and have the possibility to cancel if it takes too long
  • rateMinimum: Ensures that a function is called at a set rate

Iteration over values

  • repeat / @{link repeatAwait}: Runs a function a given number of times, yielding results as they come in

Monitoring

  • hasElapsed: Returns true when certain time has passed
  • retryFunction: Keep calling a function until it returns a value
  • retryTask: Keep trying a task until it succeeds
  • waitFor: Try to run something but take action if it fails or doesn't return
  • singleItem: Wait for a single value to be produced
  • SyncWait: Simple synchronisation
  • RequestResponseMatch: Housekeeping of matching requests from A with responses from B and handling failures

Executing

Loops

  • continuously: Run code in a loop, as fast as possible or with a delay between each execution
  • delayLoop: A generator that yields at a given rate

Timers

Etc

// If library is stored two directories up under `ixfx/`
import {continuously, stateMachine} from '../../ixfx/dist/flow.js';
// Import from web
import {continuosly, stateMachine} from 'https://unpkg.com/ixfx/dist/flow.js'

References

Re-exports Since
Re-exports infinity
Re-exports interval
Re-exports once
Re-exports since