• Returns the cached function results if already runned with this method

    Example

    const test = cache(() => setTimeout(console.log, 1000, test)); test(); // takes a second to log 'test' test(); // instantly logs the second 'test'

    Type Parameters

    • F extends ((...args: unknown[]) => unknown)

    Parameters

    • func: F

    Returns F

Generated using TypeDoc