UNPKG

@scayle/storefront-nuxt

Version:

Nuxt integration for the SCAYLE Commerce Engine and Storefront API

16 lines (15 loc) 892 B
import type { Log, CacheInterface } from '@scayle/storefront-core'; /** * Creates and returns a bound cached function. * * It initializes a new `Cached` instance with provided parameters and * returns its `execute` method bound to the instance. * This allows for easy use of the caching functionality provided by `@scayle/storefront-core`. * * @param $cache The cache interface instance. * @param $log The logging instance. * @param enabled Whether caching is enabled or not. Defaults to true if undefined. * * @returns A bound function that can be used to execute cached operations. */ export declare function getCachedFunction($cache: CacheInterface, $log: Log, enabled: boolean | undefined): <TArgs extends unknown[], TResult>(fn: (...args: TArgs) => Promise<TResult>, options?: import("@scayle/storefront-core").CacheOptions) => Awaited<(...args: TArgs) => Promise<TResult>>;