Angular Signal Generators
    Preparing search index...

    Options that control the behavior of gatedEffect.

    interface GatedEffectOptions {
        allowSignalWrites?: boolean;
        debugName?: string;
        filter?: () => boolean;
        injector?: Injector;
        manualCleanup?: boolean;
        start?: () => boolean;
        times?: number;
        until?: () => boolean;
    }

    Hierarchy

    • CreateEffectOptions
      • GatedEffectOptions
    Index

    Properties

    allowSignalWrites?: boolean

    no longer required, signal writes are allowed by default.

    debugName?: string

    A debug name for the effect. Used in Angular DevTools to identify the effect.

    filter?: () => boolean

    Prevents execution of the effect if this returns false.

    injector?: Injector

    The Injector in which to create the effect.

    If this is not provided, the current injection context will be used instead (via inject).

    manualCleanup?: boolean

    Whether the effect should require manual cleanup.

    If this is false (the default) the effect will automatically register itself to be cleaned up with the current DestroyRef.

    If this is true and you want to use the effect outside an injection context, you still need to provide an Injector to the effect.

    start?: () => boolean

    A condition that will prevent the effect from running until it is true.
    Once it is true once, it will not be checked again.

    times?: number

    The number of times the effect should run.
    Only increments if the effect function is run, so occasions where filter or start return false aren't counted.
    If until is also set, then whichever comes first will terminate the effect.

    until?: () => boolean

    A condition that will terminate the effect.
    If times is also set, then whichever comes first will terminate the effect.