UNPKG

@sapphire/utilities

Version:
9 lines (7 loc) 289 B
/** * Lazily creates a constant or load a module and caches it internally * @param cb The callback to lazily run * @returns The value returned by the callback, or the cached value if it was already initialised once. */ declare function lazy<T>(cb: () => T): () => T; export { lazy };