Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "memoize1"

Index

Functions

Functions

Const memoize1

  • memoize1<A, B>(fn: Fn<A, B>, cache?: MapLike<A, B>): (Anonymous function)
  • Optimized memoization for single arg functions. If the function expects args other than strings or numbers, you MUST provide a Map implementation which supports value (rather than object) equality, e.g. one of those provided by {@link @thi.ng/associative# | @thi.ng/associative}. Using a native Map type here will lead to memory leaks! Alternatively, use {@link (memoizeJ:1)}.

    Type parameters

    • A

    • B

    Parameters

    • fn: Fn<A, B>

      -

    • Optional cache: MapLike<A, B>

      -

    Returns (Anonymous function)

Generated using TypeDoc