turbodombuilder - v0.9.22
    Preparing search index...

    Function callOnce

    • Function

      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();