MCPcopy Create free account
hub / github.com/axe-api/axe-api / fastSingleton

Method fastSingleton

packages/axe-api/src/Services/IoCService.ts:42–45  ·  view source on GitHub ↗

* Adding a singleton dependency and create the first instance immediately. * * @param name * @param callback * @example * * IoCService.singleton("MySingleton", () => new MySingleton())

(name: string, callback: any)

Source from the content-addressed store, hash-verified

40 * IoCService.singleton("MySingleton", () => new MySingleton())
41 */
42 static fastSingleton(name: string, callback: any) {
43 this._add(DependencyTypes.SINGLETON, name, callback);
44 this.use(name);
45 }
46
47 /**
48 * Getting the service by the name.

Callers 1

analyzeVersionsMethod · 0.80

Calls 2

_addMethod · 0.95
useMethod · 0.95

Tested by

no test coverage detected