@kontsedal/olas-core 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{root-DqWolle_.mjs → root-B6pNq75w.mjs} +14 -1
- package/dist/{root-DqWolle_.mjs.map → root-B6pNq75w.mjs.map} +1 -1
- package/dist/{root-lBp7qziQ.cjs → root-CFgYhBd-.cjs} +14 -1
- package/dist/{root-lBp7qziQ.cjs.map → root-CFgYhBd-.cjs.map} +1 -1
- package/dist/testing.cjs +1 -1
- package/dist/testing.d.cts +1 -1
- package/dist/testing.d.mts +1 -1
- package/dist/testing.mjs +1 -1
- package/dist/{types-BH1o6nYa.d.mts → types-Bmi04hDI.d.mts} +12 -1
- package/dist/{types-BH1o6nYa.d.mts.map → types-Bmi04hDI.d.mts.map} +1 -1
- package/dist/{types-C4Vtkxbn.d.cts → types-BsZMPPOE.d.cts} +12 -1
- package/dist/{types-C4Vtkxbn.d.cts.map → types-BsZMPPOE.d.cts.map} +1 -1
- package/package.json +1 -1
- package/src/controller/instance.ts +15 -0
- package/src/controller/root.ts +6 -0
- package/src/controller/types.ts +11 -0
|
@@ -3457,6 +3457,18 @@ var ControllerInstance = class ControllerInstance {
|
|
|
3457
3457
|
childCounter = 0;
|
|
3458
3458
|
/** Scope values provided on this instance, keyed by `Scope.__id`. */
|
|
3459
3459
|
scopes = null;
|
|
3460
|
+
/**
|
|
3461
|
+
* Pre-seed scopes from outside the factory — used by `createRoot`'s
|
|
3462
|
+
* `scopes:` option so an adapter (e.g. `@kontsedal/olas-router-tanstack`)
|
|
3463
|
+
* can publish cross-cutting values without forcing the user to call
|
|
3464
|
+
* `ctx.provide(...)` in their root controller. Idempotent per scope id:
|
|
3465
|
+
* later calls override.
|
|
3466
|
+
*/
|
|
3467
|
+
seedScopes(bindings) {
|
|
3468
|
+
if (bindings.length === 0) return;
|
|
3469
|
+
if (this.scopes === null) this.scopes = /* @__PURE__ */ new Map();
|
|
3470
|
+
for (const [scope, value] of bindings) this.scopes.set(scope.__id, value);
|
|
3471
|
+
}
|
|
3460
3472
|
constructor(parent, rootShared, pathSegment, deps) {
|
|
3461
3473
|
this.parent = parent;
|
|
3462
3474
|
this.rootShared = rootShared;
|
|
@@ -4168,6 +4180,7 @@ function createRootWithProps(def, props, options) {
|
|
|
4168
4180
|
onError: options.onError,
|
|
4169
4181
|
queryClient
|
|
4170
4182
|
}, "root", options.deps);
|
|
4183
|
+
if (options.scopes !== void 0 && options.scopes.length > 0) instance.seedScopes(options.scopes);
|
|
4171
4184
|
let api;
|
|
4172
4185
|
try {
|
|
4173
4186
|
api = instance.construct(getFactory(def), props);
|
|
@@ -4356,4 +4369,4 @@ Object.defineProperty(exports, "untracked", {
|
|
|
4356
4369
|
}
|
|
4357
4370
|
});
|
|
4358
4371
|
|
|
4359
|
-
//# sourceMappingURL=root-
|
|
4372
|
+
//# sourceMappingURL=root-CFgYhBd-.cjs.map
|