Type Alias FunctionOptions

FunctionOptions: Partial<InitLazyStreamOptions> & {
    closeOnError: boolean;
    interval: Interval;
    lazy: Lazy;
    manual: boolean;
    maximumRepeats: number;
    predelay: Interval;
    signal: AbortSignal;
}

Type declaration

  • closeOnError: boolean

    If true, stream closes if function throws an error. If false, errors are emitted as signals, but stream is not closed. Default: true

  • interval: Interval

    If specified, function is called repeatedly with this delay

  • lazy: Lazy

    Laziness

    • start: only begins on first subscriber. Keeps running even when there are no subscribers
    • very: only begins on first subscriber. Stops looping if there are no subscribers
    • never: begins calling function when initalised and doesn't stop until Reactive is disposed
  • manual: boolean

    If true, no automatic calling of function will happen, it will only be executed if the reactive gets a ping When this is set, 'interval' is ignored. 'maximumRepeats' and 'predelay' still apply. Default: false

  • maximumRepeats: number

    If specified, sets an upper limit of how many times we loop (if this is also enabled)

  • predelay: Interval

    If specified, a time before invoking function. If repeat is used, this is in addition to interval time.

  • signal: AbortSignal

    If specified, signal is checked to prevent function execution. Also used for aborting a looped fromFunction.