Type Alias ContinuouslyOpts

ContinuouslyOpts: Readonly<{
    fireBeforeWait: boolean;
    onStartCalled: ((ticks?: number, elapsedMs?: number) => OnStartCalled);
    signal: AbortSignal;
}>

Options for continuously

Type declaration

  • fireBeforeWait: boolean

    If true, callback runs before waiting period.

    false
    
  • onStartCalled: ((ticks?: number, elapsedMs?: number) => OnStartCalled)

    Called whenever .start() is invoked. If this function returns:

    • continue: the loop starts if it hasn't started yet, or continues if already started
    • cancel: loop stops, but can be re-started if .start() is called again
    • dispose: loop stops and will throw an error if .start() is attempted to be called
    • reset: loop resets (ie. existing scheduled task is cancelled)
  • signal: AbortSignal

    Abort signal to exit loop