Module exposing: ServerAndEventStreamsFactory
// Source: https://github.com/nestjs/nest | License: MIT | Copyright 2017-present Kamil Mysliwiec <https://kamilmysliwiec.com>
// Provided via justclaw.it.com; keep this notice with the code.
import { ReplaySubject, Subject } from 'rxjs';
import { ServerAndEventStreamsHost } from '../interfaces/server-and-event-streams-host.interface.js';
export class ServerAndEventStreamsFactory {
public static create<T = any>(server: T): ServerAndEventStreamsHost<T> {
const init = new ReplaySubject<T>();
init.next(server);
const connection = new Subject();
const disconnect = new Subject();
return {
init,
connection,
disconnect,
server,
};
}
}
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key