MCPcopy
hub / github.com/nukeop/nuclear / #withHost

Method #withHost

packages/plugin-sdk/src/api/settings.ts:24–30  ·  view source on GitHub ↗
(fn: (host: SettingsHost) => T)

Source from the content-addressed store, hash-verified

22 }
23
24 #withHost<T>(fn: (host: SettingsHost) => T): T {
25 const host = this.#host;
26 if (!host) {
27 throw new Error('Settings host not available');
28 }
29 return fn(host);
30 }
31
32 register(defs: SettingDefinition[]) {
33 return this.#withHost((h) => h.register(defs));

Callers 6

registerMethod · 0.95
getMethod · 0.95
setMethod · 0.95
getGlobalMethod · 0.95
setGlobalMethod · 0.95
subscribeMethod · 0.95

Calls 1

fnFunction · 0.85

Tested by

no test coverage detected