WebSocketHandler constructor
WebSocketHandler({
- required void message(),
- void open()?,
- void close(
- ServerWebSocket, [
- JSNumber?,
- JSString?
- void error()?,
Creates a new websocket handler.
Implementation
factory WebSocketHandler({
required void Function(ServerWebSocket, JSAny) message,
void Function(ServerWebSocket)? open,
void Function(ServerWebSocket, [JSNumber?, JSString?])? close,
void Function(ServerWebSocket, JSAny)? error,
}) {
final inner = JSObject()..['message'] = message.toJS;
return WebSocketHandler._(inner);
}