You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
760 B
15 lines
760 B
import {isServerAction, ServerAction} from "./ServerAction";
|
|
import {AppAction} from "./AppAction";
|
|
import {ClientAction, isClientAction} from "./ClientAction";
|
|
|
|
// Terminology: Messages are the data packets sent and received over the WebSocket connection.
|
|
// Commands are the protocol laid on top of messages.
|
|
// Actions are data objects that the client uses to communicate between parts of itself.
|
|
// All commands are both messages and actions.
|
|
// An action is a message if and only if it is a command.
|
|
// A message is an action if and only if it is a command.
|
|
|
|
export type NetworkAction = ServerAction | ClientAction;
|
|
export function isNetworkAction(action: AppAction): action is NetworkAction {
|
|
return isServerAction(action) || isClientAction(action)
|
|
} |