type-alias / @typed/fx/Fx

ThrottleOptions

Options for {@link throttle}. A duration-only call is leading-edge ({ leading: true, trailing: false }).

Package version
2.0.0-beta.7
Category
Operator options
Since
1.0.0

Import

import { ThrottleOptions } from "@typed/fx/Fx";

Signatures

export type ThrottleOptions = {
    readonly duration: Duration.Input;
    readonly leading?: boolean | undefined;
    readonly trailing?: boolean | undefined;
};

Why

Leading and trailing edges answer different interaction needs, so the window policy is explicit rather than hidden behind separate operators.

Ownership and lifetime

This immutable value owns no resource. throttle reads it when constructing the Fx; the resulting subscription owns the timer and pending value.

Examples

import type { ThrottleOptions } from "@typed/fx/Fx"

const options: ThrottleOptions = {
  duration: "250 millis",
  leading: true,
  trailing: true
}

Other public imports

These import paths expose the same declaration. Each page retains its own public name and signature.

Source