Class export=

Constructors

Properties

Cache: typeof Cache = Cache
CachedWorker: typeof CachedWorker = CachedWorker
FsTransport: typeof FsTransport = FsTransport
LocalStorageTransport: typeof LocalStorageTransport = LocalStorageTransport
deco: {
    debounce: ((timeoutMs?: number) => ((target: any, propertyKey: any, descriptor?: any) => any));
    memoize: (<TMethod, TThis>(opts?: ICacheOpts & IMemoizeOpts<TMethod, TThis>) => ((target: any, propertyKey: any, descriptor?: any) => any));
    queued: ((opts?: {
        throttle?: number;
        timeout?: number;
        trimQueue?: boolean;
    }) => ((target: any, propertyKey: any, descriptor?: any) => any));
    throttle: {
        (timeWindow: number, shouldCallLater?: boolean): any;
        (timeWindow: number, options?: IThrottleOptions): any;
    };
} = ...

Type declaration

  • debounce: ((timeoutMs?: number) => ((target: any, propertyKey: any, descriptor?: any) => any))
      • (timeoutMs?): ((target: any, propertyKey: any, descriptor?: any) => any)
      • Parameters

        • OptionaltimeoutMs: number

          ms to wait before calling inner fn

        Returns ((target: any, propertyKey: any, descriptor?: any) => any)

          • (target, propertyKey, descriptor?): any
          • Parameters

            • target: any
            • propertyKey: any
            • Optionaldescriptor: any

            Returns any

  • memoize: (<TMethod, TThis>(opts?: ICacheOpts & IMemoizeOpts<TMethod, TThis>) => ((target: any, propertyKey: any, descriptor?: any) => any))
      • <TMethod, TThis>(opts?): ((target: any, propertyKey: any, descriptor?: any) => any)
      • Type Parameters

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

        Parameters

        Returns ((target: any, propertyKey: any, descriptor?: any) => any)

          • (target, propertyKey, descriptor?): any
          • Parameters

            • target: any
            • propertyKey: any
            • Optionaldescriptor: any

            Returns any

  • queued: ((opts?: {
        throttle?: number;
        timeout?: number;
        trimQueue?: boolean;
    }) => ((target: any, propertyKey: any, descriptor?: any) => any))
      • (opts?): ((target: any, propertyKey: any, descriptor?: any) => any)
      • Parameters

        • opts: {
              throttle?: number;
              timeout?: number;
              trimQueue?: boolean;
          } = null
          • Optionalthrottle?: number
          • Optionaltimeout?: number
          • OptionaltrimQueue?: boolean

        Returns ((target: any, propertyKey: any, descriptor?: any) => any)

          • (target, propertyKey, descriptor?): any
          • Parameters

            • target: any
            • propertyKey: any
            • Optionaldescriptor: any

            Returns any

  • throttle: {
        (timeWindow: number, shouldCallLater?: boolean): any;
        (timeWindow: number, options?: IThrottleOptions): any;
    }
      • (timeWindow, shouldCallLater?): any
      • Calls function maximal each time window frame

        Parameters

        • timeWindow: number

          how often, in ms, should the function be called

        • OptionalshouldCallLater: boolean

          start calling fn on frame start

        Returns any

      • (timeWindow, options?): any
      • Parameters

        • timeWindow: number
        • Optionaloptions: IThrottleOptions

        Returns any

default: typeof export=
fn: {
    clearMemoized: ((fn: Function, ...args: any[]) => void);
    memoize: (<TMethod, TThis>(fn: TMethod, opts?: ICacheOpts & IMemoizeOpts<TMethod, TThis>, key?: string) => IMemoizeWrapper & TMethod);
    queued: (<T>(fn: T, opts?: IQueueOpts) => T);
} = ...

Type declaration

  • clearMemoized: ((fn: Function, ...args: any[]) => void)
      • (fn, ...args): void
      • Parameters

        • fn: Function
        • Rest...args: any[]

        Returns void

  • memoize: (<TMethod, TThis>(fn: TMethod, opts?: ICacheOpts & IMemoizeOpts<TMethod, TThis>, key?: string) => IMemoizeWrapper & TMethod)
      • <TMethod, TThis>(fn, opts?, key?): IMemoizeWrapper & TMethod
      • Type Parameters

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

        Parameters

        Returns IMemoizeWrapper & TMethod

  • queued: (<T>(fn: T, opts?: IQueueOpts) => T)
      • <T>(fn, opts?): T
      • For original async method - ensure it is called one after another

        Type Parameters

        • T extends Function

        Parameters

        • fn: T
        • opts: IQueueOpts = {}

        Returns T