Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "utils"

file

Various utilities that don't belong anywhere else.

author

Nathan Pennie kb1rd@kb1rd.net

Index

Classes

Functions

Functions

ifNeeded

  • ifNeeded<T>(cb: () => T): () => T
  • Returns a function that will return the value of cb by calling it once, then returning the same value each time after. This is used to compute a value that may be used multiple times, but is expensive to compute if unnecessary.

    Type parameters

    • T

    Parameters

    • cb: () => T

      The function to determine the value of

        • (): T
        • Returns T

    Returns () => T

    The value returned by cb

      • (): T
      • Returns T

Generated using TypeDoc