Switch to a context store for server stuff to better support things in the future

This commit is contained in:
Dane Everitt 2019-07-09 21:25:57 -07:00
parent 16e6f3f45f
commit 986285402f
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
21 changed files with 218 additions and 148 deletions

View file

@ -1,22 +0,0 @@
import { Action, action } from 'easy-peasy';
import { Websocket } from '@/plugins/Websocket';
export interface SocketState {
instance: Websocket | null;
connected: boolean;
setInstance: Action<SocketState, Websocket | null>;
setConnectionState: Action<SocketState, boolean>;
}
const socket: SocketState = {
instance: null,
connected: false,
setInstance: action((state, payload) => {
state.instance = payload;
}),
setConnectionState: action((state, payload) => {
state.connected = payload;
}),
};
export default socket;