StaticCache
Cache: typeof Cache = Cache
StaticCachedWorker
CachedWorker: typeof CachedWorker = CachedWorker
StaticFsTransport
FsTransport: typeof FsTransport = FsTransport
StaticLocalStorageTransport
LocalStorageTransport: typeof LocalStorageTransport = LocalStorageTransport
Staticdeco
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
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
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;
} = nullOptionalthrottle?: 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
Parameters
- timeWindow: number
OptionalshouldCallLater: boolean
Returns any
- (timeWindow, options?): any
Parameters
- timeWindow: number
Optionaloptions: IThrottleOptions
Returns any
Staticfn
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
Returns IMemoizeWrapper & TMethod
queued: (<T>(fn: T, opts?: IQueueOpts) => T)
- <T>(fn, opts?): T
Parameters
- fn: T
- opts: IQueueOpts = {}
Returns T
ms to wait before calling inner fn