Function div

Setter for caching value within diInit callback

Call it with value for caching

Call it without arguments for getting value from cache

const num = dic<number>()
num(5) // cache 5 inside `num` setter
num() // 5
num(10) // change cached value to 10
num() // 10
  • Type Parameters

    • T

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

      • (x?): T
      • Parameters

        • Optionalx: T

        Returns T