Correctly handle socket state in the app and make it possible to listen for events

This commit is contained in:
Dane Everitt 2019-06-29 16:57:11 -07:00
parent f0ca8bc3a3
commit c8d89e0964
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
6 changed files with 89 additions and 16 deletions

View file

@ -1,10 +1,10 @@
import { Action, action } from 'easy-peasy';
import Sockette from 'sockette';
import { Websocket } from '@/plugins/Websocket';
export interface SocketState {
instance: Sockette | null;
instance: Websocket | null;
connected: boolean;
setInstance: Action<SocketState, Sockette | null>;
setInstance: Action<SocketState, Websocket | null>;
setConnectionState: Action<SocketState, boolean>;
}