@portfolio-resilience/core
    Preparing search index...

    Variable IdempotencyContextConst

    IdempotencyContext: {
        get currentKey(): string | undefined;
        generateFromCorrelation(): string;
        push(key: string): () => void;
        run<T>(key: string, fn: () => T): T;
    } = ...

    Portfolio.Resilience — TypeScript port.

    Public API surface mirroring the C# and Python implementations.

    Type Declaration

    • get currentKey(): string | undefined

      Current idempotency key, or undefined if not set.

    • generateFromCorrelation: function
      • Generate a key from the current correlation ID or a random UUID.

        Returns string

    • push: function
      • Push an idempotency key for the current async scope. Returns a restore function.

        Parameters

        • key: string

        Returns () => void

    • run: function
      • Run fn with the given idempotency key, restoring previous on exit.

        Type Parameters

        • T

        Parameters

        • key: string
        • fn: () => T

        Returns T