UNPKG

@state-sync/redux-path-reducer

Version:
58 lines (57 loc) 1.71 kB
import AbstractStore from './AbstractStore'; /** * Interface of connection status listener. */ export interface IConnectionStatusListener { /** * Invoked then client starts connecting to the server */ onConnecting(): void; /** * Invoked then client actually connected to the server, but still do not completely ready to serve. */ onConnected(): void; /** * Invoked on disconnect for any reason */ onDisconnect(reconnectTimeout: number): void; /** * Invoked then client connected to server and completely configured on service level, * but doesn't yet receive all confirmations for subscriptions. */ onConfigured(): void; /** * Client is completely set up and can initialize sync areas. */ onReady(): void; } /** * This implementation just skip all events and keep silent */ export declare class ConnectionStatusListenerSilent implements IConnectionStatusListener { onConnecting(): void; onConnected(): void; onDisconnect(reconnectTimeout: number): void; onConfigured(): void; onReady(): void; } /** * Delivery connection status to the store (redux or NgRx). */ export declare class ConnectionStatusListenerForStore implements IConnectionStatusListener { /** * Reference to the store */ private storeProvider; /** * Construct listener using provider store interface * @param {AbstractStore} storeProvider */ constructor(storeProvider: () => AbstractStore); private dispatchStatus(payload); onReady(): void; onConnecting(): void; onConnected(): void; onDisconnect(reconnectTimeout: number): void; onConfigured(): void; }