memoize-weak-decorator
Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type aliases

AnyFunction

AnyFunction: function

Type declaration

    • (...args: any[]): any
    • Parameters

      • Rest ...args: any[]

      Returns any

DecorateMemoizeParams

DecorateMemoizeParams: Partial

MemoizeParams

MemoizeParams: object

Type declaration

  • Optional fixedArgsLength?: number
  • function: F
  • Optional getAdditionalArgs?: function
      • (): any[]
      • Returns any[]

Variables

UNDEFINED

UNDEFINED: any = {} as any
author

adufilie http://github.com/adufilie

Functions

decorate

  • decorate<T>(descriptor: TypedPropertyDescriptor<T>, params?: DecorateMemoizeParams): TypedPropertyDescriptor<T>

isPrimitive

  • isPrimitive(value: any): boolean
  • Parameters

    • value: any

    Returns boolean

memoize

  • memoize<F>(params: MemoizeParams): F
  • memoize<T>(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T>): TypedPropertyDescriptor<T> | void
  • Creates a memoized version of a function.

    Type parameters

    Parameters

    Returns F

  • A method decorator that creates a memoized version of a method.

    Type parameters

    Parameters

    • target: Object
    • propertyKey: string | symbol
    • descriptor: TypedPropertyDescriptor<T>

    Returns TypedPropertyDescriptor<T> | void

memoizeWith

  • memoizeWith<T, P, TARGET>(getMemoizeParams_propName: P): function
  • Generates a method decorator that creates a memoized version of a function with additional args to control memoization

    Type parameters

    Parameters

    • getMemoizeParams_propName: P

      The name of another class method that returns additional arguments for controlling memoization.

    Returns function

      • <T>(target: TARGET, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T>): TypedPropertyDescriptor<T> | void
      • Type parameters

        • T

        Parameters

        • target: TARGET
        • propertyKey: string | symbol
        • descriptor: TypedPropertyDescriptor<T>

        Returns TypedPropertyDescriptor<T> | void

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc