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