@adaskothebeast/ngxs-signalr-plugin
Version:
Bind server SignalR events to Ngxs store actions.
34 lines (33 loc) • 1.18 kB
TypeScript
import { OnDestroy } from '@angular/core';
import { Actions, Store } from '@ngxs/store';
import { SignalROptions } from './signalr-options';
import * as i0 from "@angular/core";
export declare class SignalRHandler implements OnDestroy {
private store;
private actions$;
private options;
private connection;
private subscription;
private streamSubscriptions;
private typeKey;
constructor(store: Store, actions$: Actions, options: SignalROptions);
ngOnDestroy(): void;
private setupActionsListeners;
private setupConnection;
private setupHandlers;
private connect;
private disconnect;
private send;
private invoke;
private stream;
/**
* To ensure we don't have any memory leaks
* e.g. if the user occasionally dispatched `ConnectWebSocket` twice
* then the previous subscription will still live in the memory
* to prevent such behavior - we close the previous connection if it exists
*/
private updateConnection;
private closeConnection;
static ɵfac: i0.ɵɵFactoryDeclaration<SignalRHandler, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<SignalRHandler>;
}