UNPKG

@100mslive/hms-video-store

Version:

@100mslive Core SDK which abstracts the complexities of webRTC while providing a reactive store for data management with a unidirectional data flow

22 lines (21 loc) 726 B
import { IHMSStore } from '../../IHMSStore'; import { HMSGenericTypes, HMSStore } from '../../schema'; declare type ActionName = string; declare type SetState = (store: HMSStore) => void; /** * pass in an action and an update function, the update functions will be batched and run such that * store updates are limited to only one action in a time interval * */ export declare class ActionBatcher<T extends HMSGenericTypes = { sessionStore: Record<string, any>; }> { private queuedUpdates; private timers; private DEFAULT_INTERVAL_MS; private store; constructor(store: IHMSStore<T>); setState(fn: SetState, action: ActionName, timeout?: number): void; private setStateBatched; } export {};