import { matchEvent } from '@marblejs/core';
matchEvent :: (EventLike | EventCreator) -> Observable<Event> -> Observable<Event>
import { matchEvent } from '@marblejs/core';
import { WsEffect } from '@marblejs/websockets';
const add$: WsEffect = event$ =>
event$.pipe(
matchEvent('ADD'),
map(event => event.payload), // (typeof payload) = unknown
// ...
);
import { matchEvent, HttpServerEffect, ServerEvent } from '@marblejs/core';
const listening$: HttpServerEffect = event$ =>
event$.pipe(
matchEvent(ServerEvent.listening),
map(event => event.payload), // (typeof payload) = { port: number; host: string; }
// ...
);