Function once

  • A class method decorator that limits a method to be called only once. All subsequent calls will return the result of the first call.

    Type Parameters

    • This
    • Args extends any[]
    • Return

    Parameters

    • fn: ((this, ...args) => Return)
    • Optional context: ClassMethodDecoratorContext<This, ((this, ...args) => Return)>

    Returns ((this, ...args) => Return)