* moved constants to a proper files * added new action constants * updated websocket reducers and actions * updated websocket saga to handle proper socket events * updated initialization * updated multi pointer arena + realtime app editors components * minor feedback update * updated events list by socket level * removed e.persist * passing socket obj rather than just id
52 lines
1.5 KiB
TypeScript
52 lines
1.5 KiB
TypeScript
import {
|
|
ReduxActionTypes,
|
|
ReduxSagaChannels,
|
|
} from "constants/ReduxActionConstants";
|
|
import { reconnectWebsocketEvent } from "constants/WebsocketConstants";
|
|
|
|
export const setIsAppLevelWebsocketConnected = (payload: boolean) => ({
|
|
type: ReduxActionTypes.SET_IS_APP_LEVEL_WEBSOCKET_CONNECTED,
|
|
payload,
|
|
});
|
|
export const setIsPageLevelWebsocketConnected = (payload: boolean) => ({
|
|
type: ReduxActionTypes.SET_IS_PAGE_LEVEL_WEBSOCKET_CONNECTED,
|
|
payload,
|
|
});
|
|
|
|
export const appLevelWebsocketWriteEvent = (payload: {
|
|
type: string;
|
|
payload?: any;
|
|
}) => ({
|
|
type: ReduxSagaChannels.WEBSOCKET_APP_LEVEL_WRITE_CHANNEL,
|
|
payload,
|
|
});
|
|
export const pageLevelWebsocketWriteEvent = (payload: {
|
|
type: string;
|
|
payload?: any;
|
|
}) => ({
|
|
type: ReduxSagaChannels.WEBSOCKET_PAGE_LEVEL_WRITE_CHANNEL,
|
|
payload,
|
|
});
|
|
|
|
export const reconnectAppLevelWebsocket = () =>
|
|
appLevelWebsocketWriteEvent(reconnectWebsocketEvent());
|
|
|
|
export const retryAppLevelSocketConnection = () => ({
|
|
type: ReduxActionTypes.RETRY_APP_LEVEL_WEBSOCKET_CONNECTION,
|
|
});
|
|
|
|
export const initAppLevelSocketConnection = () => ({
|
|
type: ReduxActionTypes.INIT_APP_LEVEL_SOCKET_CONNECTION,
|
|
});
|
|
|
|
export const reconnectPageLevelWebsocket = () =>
|
|
pageLevelWebsocketWriteEvent(reconnectWebsocketEvent());
|
|
|
|
export const retryPageLevelSocketConnection = () => ({
|
|
type: ReduxActionTypes.RETRY_PAGE_LEVEL_WEBSOCKET_CONNECTION,
|
|
});
|
|
|
|
export const initPageLevelSocketConnection = () => ({
|
|
type: ReduxActionTypes.INIT_PAGE_LEVEL_SOCKET_CONNECTION,
|
|
});
|