/** * @author Martin Karkowski * @email m.karkowski@zema.de * @create date 2020-11-06 08:52:48 * @modify date 2020-11-06 08:52:49 * @desc [description] */ import { getSingleton } from "../helpers/singletonMethod"; import { NopeObservable } from "../observables/nopeObservable"; import { INopeRpcDispatcherOptions } from "../types/nope/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 }