turbodombuilder - v0.9.5
    Preparing search index...

    Function callOnce

    • callOnce

      Type Parameters

      • Type extends (...args: any[]) => any

      Parameters

      • fn: Type

        The function to process.

      Returns Type

      Function wrapper that ensures the passed function is called only once. Subsequent calls will just return the cached computed result (if any) of the first call of that function.

      const init = callOnce(function () { ... });
      const out = init();