Function dic

Setter for caching constant value within diInit callback

Call it with constant value for caching

Call it without arguments for getting constant value from cache

const num = dic<number>()
num(5) // cache 5 inside `num` setter
num() // 5
num(10) // no affect, because 5 already cached
num() // 5
  • Type Parameters

    • T

    Returns ((x?: T) => T)

      • (x?): T
      • Parameters

        • Optionalx: T

        Returns T