import { getSingleton } from "../helpers/singletonMethod"; import { NopeObservable } from "../observables/nopeObservable"; import { INopeRpcDispatcherOptions } from "../types/communication.interface"; import { nopeDispatcher } from "./nopeDispatcher"; /** * Function to extract a Singleton Dispatcher * @param options The provided options for the Dispatcher */ export function getRpcDispatcher(options: INopeRpcDispatcherOptions) { const container = getSingleton('nopeBackendDispatcher.instance', () => { return new nopeDispatcher(options, () => new NopeObservable()); }); return container.instance }