vue-fn 0.3.0-rc → 0.4.1-rc
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/README.md +64 -2
- package/domain/bind.d.ts +3 -0
- package/domain/event.d.ts +6 -6
- package/domain/index.d.ts +1 -1
- package/domain/index.mjs +115 -90
- package/domain/index.mjs.map +1 -1
- package/domain-server/bind.d.ts +3 -0
- package/domain-server/event.d.ts +6 -6
- package/domain-server/index.d.ts +1 -1
- package/domain-server/index.mjs +115 -90
- package/domain-server/index.mjs.map +1 -1
- package/domain-shared/agg.d.ts +25 -0
- package/domain-shared/event.d.ts +19 -0
- package/domain-shared/index.d.ts +5 -0
- package/domain-shared/index.mjs +280 -0
- package/domain-shared/index.mjs.map +1 -0
- package/domain-shared/type.d.ts +73 -0
- package/{index-Dhhr_iXc.js → index-BcykEFlB.js} +3 -3
- package/{index-Dhhr_iXc.js.map → index-BcykEFlB.js.map} +1 -1
- package/package.json +21 -3
- package/timer/index.mjs +2 -2
- package/timer/index.mjs.map +1 -1
- package/pure-domain/agg.d.ts +0 -0
- package/pure-domain/event.d.ts +0 -42
- package/pure-domain/index.d.ts +0 -0
- package/pure-domain/index.mjs +0 -2
- package/pure-domain/index.mjs.map +0 -1
- package/pure-domain/state.d.ts +0 -7
- package/shared-domain/index.d.ts +0 -19
- package/shared-domain/index.mjs +0 -59
- package/shared-domain/index.mjs.map +0 -1
- package/shared-domain/package.json +0 -5
- /package/{shared-domain → domain-shared}/common.d.ts +0 -0
- /package/{pure-domain → domain-shared}/package.json +0 -0
package/README.md
CHANGED
|
@@ -1,5 +1,67 @@
|
|
|
1
1
|
# vue-fn
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A Vue 3 reactive function utility library providing domain-driven design patterns and reactive state management utilities.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Domain-Driven Design** - Functional implementation of DDD patterns with events, aggregations, and plugins
|
|
8
|
+
- **Modular Architecture** - Multiple independently consumable modules with tree-shaking support
|
|
9
|
+
- **Vue 3 Reactive** - Built on `@vue/reactivity` for full reactive system integration
|
|
10
|
+
- **Type Safety** - Complete TypeScript support for excellent developer experience
|
|
11
|
+
- **Client/Server** - Separate `domain` module for browsers, `domain-server` for Node.js environments
|
|
12
|
+
- **Cross-Tab State** - `shared-domain` module provides cross-tab/window state sharing via BroadcastChannel API
|
|
13
|
+
- **Two-Way Binding** - `bindRef` and `bindReactive` utilities for reactive data binding
|
|
14
|
+
|
|
15
|
+
## Modules
|
|
16
|
+
|
|
17
|
+
| Package | Description |
|
|
18
|
+
| :-------------------------------------------- | :------------------------------------------------------------------------------------------- |
|
|
19
|
+
| [`@vue-fn/domain`](libs/domain) | Vue-reactive domain implementation with aggregations, plugins, and event system |
|
|
20
|
+
| [`@vue-fn/domain-server`](libs/domain-server) | Server-side variant for Node.js environments |
|
|
21
|
+
| [`@vue-fn/domain-shared`](libs/domain-shared) | Cross-tab/window shared state using BroadcastChannel API |
|
|
22
|
+
| [`@vue-fn/timer`](libs/timer) | Async utilities: `createTimeout()` for cancellable timeouts, `createDeferred()` for promises |
|
|
23
|
+
|
|
24
|
+
## Documentation
|
|
25
|
+
|
|
26
|
+
Full documentation is available at [https://alphafoxz.github.io/vue-fn](https://alphafoxz.github.io/vue-fn)
|
|
27
|
+
|
|
28
|
+
## Installation
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
# Install the main domain module
|
|
32
|
+
npm install @vue-fn/domain
|
|
33
|
+
|
|
34
|
+
# Install other modules as needed
|
|
35
|
+
npm install @vue-fn/domain-shared
|
|
36
|
+
npm install @vue-fn/timer
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Quick Start
|
|
40
|
+
|
|
41
|
+
```typescript
|
|
42
|
+
import { createSingletonAgg } from '@vue-fn/domain';
|
|
43
|
+
import { ref } from 'vue';
|
|
44
|
+
|
|
45
|
+
const counter = createSingletonAgg(() => {
|
|
46
|
+
const count = ref(0);
|
|
47
|
+
|
|
48
|
+
return {
|
|
49
|
+
states: {
|
|
50
|
+
count,
|
|
51
|
+
},
|
|
52
|
+
commands: {
|
|
53
|
+
increment() {
|
|
54
|
+
count.value++;
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
// Use the aggregation
|
|
61
|
+
counter.api.commands.increment();
|
|
62
|
+
console.log(counter.api.states.count.value); // 1
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## License
|
|
66
|
+
|
|
67
|
+
UNLICENSED
|
package/domain/bind.d.ts
CHANGED
|
@@ -10,4 +10,7 @@ type InferValue<T> = T extends () => infer R ? R : T extends Readonly<Ref<any>>
|
|
|
10
10
|
export declare function bindRef<STATE extends DomainAggState | SingleFieldRef, T extends InferValue<STATE>>(aggState: STATE, onChange: WatchCallback<T>, watchOptions?: WatchOptions & {
|
|
11
11
|
forceSync?: boolean;
|
|
12
12
|
}): Ref<T>;
|
|
13
|
+
export declare function bindReactive<STATE extends DomainAggReactiveState, T extends InferValue<STATE> & object>(aggState: STATE, onChange: WatchCallback<T>, watchOptions?: WatchOptions & {
|
|
14
|
+
forceSync?: boolean;
|
|
15
|
+
}): Reactive<T>;
|
|
13
16
|
export {};
|
package/domain/event.d.ts
CHANGED
|
@@ -11,19 +11,19 @@ export type DomainRequestEvent<DATA, REPLY_DATA> = {
|
|
|
11
11
|
listeners: DomainRequestEventListener<DATA, REPLY_DATA>[];
|
|
12
12
|
publishRequest: (data: DeepReadonly<UnwrapNestedRefs<DATA>>) => Promise<REPLY_DATA>;
|
|
13
13
|
api: {
|
|
14
|
-
latestVersion:
|
|
14
|
+
readonly latestVersion: string;
|
|
15
15
|
listenAndReply: (replyFn: DomainRequestEventListener<DATA, REPLY_DATA>) => () => void;
|
|
16
16
|
};
|
|
17
17
|
};
|
|
18
18
|
export type DomainRequestEventListener<DATA, REPLY_DATA> = (param: {
|
|
19
|
-
data: DeepReadonly<UnwrapNestedRefs<DATA>>;
|
|
20
|
-
version: string;
|
|
19
|
+
readonly data: DeepReadonly<UnwrapNestedRefs<DATA>>;
|
|
20
|
+
readonly version: string;
|
|
21
21
|
}) => REPLY_DATA;
|
|
22
22
|
export type DomainBroadcastEvent<DATA> = {
|
|
23
23
|
listeners: DomainBroadcastEventListener<DATA>[];
|
|
24
24
|
publish: (data: DeepReadonly<UnwrapNestedRefs<DATA>>) => void;
|
|
25
25
|
api: {
|
|
26
|
-
latestVersion:
|
|
26
|
+
readonly latestVersion: string;
|
|
27
27
|
listen: (cb: (event: {
|
|
28
28
|
data: DeepReadonly<UnwrapNestedRefs<DATA>>;
|
|
29
29
|
version: string;
|
|
@@ -31,8 +31,8 @@ export type DomainBroadcastEvent<DATA> = {
|
|
|
31
31
|
};
|
|
32
32
|
};
|
|
33
33
|
export type DomainBroadcastEventListener<DATA> = (param: {
|
|
34
|
-
data: DeepReadonly<UnwrapNestedRefs<DATA>>;
|
|
35
|
-
version: string;
|
|
34
|
+
readonly data: DeepReadonly<UnwrapNestedRefs<DATA>>;
|
|
35
|
+
readonly version: string;
|
|
36
36
|
}) => void;
|
|
37
37
|
export type DomainDestroyedEventApi = DomainBroadcastEvent<{}>['api'];
|
|
38
38
|
export type DomainEvent<DATA, REPLY_DATA> = DomainRequestEvent<DATA, REPLY_DATA> | DomainBroadcastEvent<DATA>;
|
package/domain/index.d.ts
CHANGED
|
@@ -4,5 +4,5 @@ export type { DomainPlugin, DomainHotSwapPlugin, DomainSetupPlugin } from './plu
|
|
|
4
4
|
export { createPluginHelperByAgg, createPluginHelperByAggCreator } from './plugin';
|
|
5
5
|
export type { DomainSingletonAgg, DomainMultiInstanceAgg } from './agg';
|
|
6
6
|
export { createSingletonAgg, createMultiInstanceAgg } from './agg';
|
|
7
|
-
export { bindRef } from './bind';
|
|
7
|
+
export { bindRef, bindReactive } from './bind';
|
|
8
8
|
export * as Utils from './common';
|
package/domain/index.mjs
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import { ref as
|
|
3
|
-
function
|
|
1
|
+
import { t as z } from "../index-BcykEFlB.js";
|
|
2
|
+
import { ref as S, computed as E, effectScope as P, onScopeDispose as R, shallowReadonly as I, readonly as h, watch as v, reactive as T, isReactive as D, isRef as C, unref as N } from "vue";
|
|
3
|
+
function F() {
|
|
4
4
|
function e(t) {
|
|
5
5
|
let o = "0", i = [];
|
|
6
6
|
const r = [];
|
|
7
|
-
function c(s, u,
|
|
8
|
-
const
|
|
9
|
-
o =
|
|
10
|
-
version:
|
|
7
|
+
function c(s, u, f, p) {
|
|
8
|
+
const a = A(o);
|
|
9
|
+
o = a, i.push({
|
|
10
|
+
version: a,
|
|
11
11
|
data: s,
|
|
12
12
|
resolve: u,
|
|
13
|
-
reject:
|
|
13
|
+
reject: f,
|
|
14
14
|
timerId: p
|
|
15
15
|
}), n();
|
|
16
16
|
}
|
|
17
17
|
function n() {
|
|
18
18
|
if (!(i.length === 0 || r.length === 0))
|
|
19
19
|
for (const s of i) {
|
|
20
|
-
const { version: u, data:
|
|
21
|
-
data:
|
|
20
|
+
const { version: u, data: f, resolve: p, reject: a, timerId: d } = s, m = {
|
|
21
|
+
data: f,
|
|
22
22
|
version: u
|
|
23
23
|
};
|
|
24
|
-
for (const
|
|
24
|
+
for (const w of r)
|
|
25
25
|
try {
|
|
26
|
-
const l =
|
|
26
|
+
const l = w(m);
|
|
27
27
|
t.onReply(l), p(l), d && clearTimeout(d);
|
|
28
28
|
} catch (l) {
|
|
29
29
|
if (t.onError && l instanceof Error)
|
|
30
|
-
t.onError(l), t.isTerminateOnError && (
|
|
30
|
+
t.onError(l), t.isTerminateOnError && (a(l), d && clearTimeout(d));
|
|
31
31
|
else
|
|
32
32
|
throw new Error("caught a unknown error" + (l?.toString() || l));
|
|
33
33
|
}
|
|
@@ -37,11 +37,11 @@ function B() {
|
|
|
37
37
|
return {
|
|
38
38
|
listeners: r,
|
|
39
39
|
async publishRequest(s) {
|
|
40
|
-
const u = new
|
|
41
|
-
let
|
|
42
|
-
return t.timeoutMs && (
|
|
40
|
+
const u = new z.Deferred();
|
|
41
|
+
let f;
|
|
42
|
+
return t.timeoutMs && (f = setTimeout(() => {
|
|
43
43
|
u.reject(new Error(`timeout: ${t.timeoutMs} ms`));
|
|
44
|
-
}, t.timeoutMs)), c(s, u.resolve, u.reject,
|
|
44
|
+
}, t.timeoutMs)), c(s, u.resolve, u.reject, f), await u.promise;
|
|
45
45
|
},
|
|
46
46
|
api: {
|
|
47
47
|
get latestVersion() {
|
|
@@ -62,7 +62,7 @@ function B() {
|
|
|
62
62
|
options: e
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
|
-
function
|
|
65
|
+
function O() {
|
|
66
66
|
let e = "0";
|
|
67
67
|
const t = [];
|
|
68
68
|
return {
|
|
@@ -96,12 +96,12 @@ function A(e) {
|
|
|
96
96
|
const i = Math.max(t.length, o.length);
|
|
97
97
|
let r = 0, c = [];
|
|
98
98
|
for (let n = 0; n < i; n++) {
|
|
99
|
-
const s = n < t.length ? parseInt(t[n], 10) : 0, u = n < o.length ? parseInt(o[n], 10) : 0,
|
|
100
|
-
c.push(
|
|
99
|
+
const s = n < t.length ? parseInt(t[n], 10) : 0, u = n < o.length ? parseInt(o[n], 10) : 0, f = s + u + r;
|
|
100
|
+
c.push(f % 10), r = Math.floor(f / 10);
|
|
101
101
|
}
|
|
102
102
|
return r > 0 && c.push(r), c.reverse().join("");
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function g(e = "") {
|
|
105
105
|
const t = Date.now().toString(36), o = Math.random().toString(36).substring(2, 10);
|
|
106
106
|
return `${e}${t}${o}`;
|
|
107
107
|
}
|
|
@@ -169,10 +169,10 @@ function _(e, t = /* @__PURE__ */ new WeakMap()) {
|
|
|
169
169
|
o[i] = _(e[i], t);
|
|
170
170
|
return o;
|
|
171
171
|
}
|
|
172
|
-
const
|
|
172
|
+
const L = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
173
173
|
__proto__: null,
|
|
174
174
|
deepClone: _,
|
|
175
|
-
genId:
|
|
175
|
+
genId: g,
|
|
176
176
|
isEqual: y
|
|
177
177
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
178
178
|
function k(e) {
|
|
@@ -195,11 +195,11 @@ function k(e) {
|
|
|
195
195
|
});
|
|
196
196
|
for (const u of Object.values(o))
|
|
197
197
|
u.mount({ api: n.api, __aggId: n.__id }), s.push(u.__id);
|
|
198
|
-
if (i.set(n, s),
|
|
198
|
+
if (i.set(n, s), b(n)) {
|
|
199
199
|
const u = n.api.events.destroyed.listen(() => {
|
|
200
200
|
delete r[n.__id], e?.(n);
|
|
201
|
-
for (const
|
|
202
|
-
|
|
201
|
+
for (const f of c)
|
|
202
|
+
f(n);
|
|
203
203
|
u?.();
|
|
204
204
|
});
|
|
205
205
|
}
|
|
@@ -210,7 +210,7 @@ function k(e) {
|
|
|
210
210
|
createSetupPlugin(n) {
|
|
211
211
|
let s;
|
|
212
212
|
return n instanceof Function ? s = n() : s = n, Object.freeze({
|
|
213
|
-
__id:
|
|
213
|
+
__id: g(),
|
|
214
214
|
type: "Setup",
|
|
215
215
|
mount(u) {
|
|
216
216
|
if (u.isInitialized.value)
|
|
@@ -222,7 +222,7 @@ function k(e) {
|
|
|
222
222
|
createHotSwapPlugin(n) {
|
|
223
223
|
let s;
|
|
224
224
|
return n instanceof Function ? s = n() : s = n, Object.freeze({
|
|
225
|
-
__id:
|
|
225
|
+
__id: g(),
|
|
226
226
|
type: "HotSwap",
|
|
227
227
|
mount: s.mount,
|
|
228
228
|
unmount: s.unmount
|
|
@@ -264,21 +264,21 @@ function k(e) {
|
|
|
264
264
|
}
|
|
265
265
|
});
|
|
266
266
|
}
|
|
267
|
-
function
|
|
267
|
+
function q(e, t) {
|
|
268
268
|
return k(t);
|
|
269
269
|
}
|
|
270
|
-
function
|
|
270
|
+
function K(e) {
|
|
271
271
|
return k();
|
|
272
272
|
}
|
|
273
|
-
function
|
|
273
|
+
function b(e) {
|
|
274
274
|
return e.type === "MultiInstance";
|
|
275
275
|
}
|
|
276
|
-
function
|
|
276
|
+
function H(e) {
|
|
277
277
|
return j(e);
|
|
278
278
|
}
|
|
279
|
-
function
|
|
279
|
+
function V(e) {
|
|
280
280
|
const t = j(e);
|
|
281
|
-
return
|
|
281
|
+
return I({
|
|
282
282
|
states: t.states,
|
|
283
283
|
commands: t.commands,
|
|
284
284
|
events: t.events
|
|
@@ -287,24 +287,24 @@ function H(e) {
|
|
|
287
287
|
function j(e) {
|
|
288
288
|
const t = e.states;
|
|
289
289
|
for (const n of Object.keys(e.states))
|
|
290
|
-
t[n] =
|
|
291
|
-
const o =
|
|
290
|
+
t[n] = h(t[n]);
|
|
291
|
+
const o = I(e.states), i = h(e.commands), r = {}, c = e.events;
|
|
292
292
|
for (const n in e.events)
|
|
293
293
|
r[n] = c[n].api;
|
|
294
|
-
return
|
|
294
|
+
return I({
|
|
295
295
|
states: o,
|
|
296
296
|
commands: i,
|
|
297
|
-
events:
|
|
297
|
+
events: I(r),
|
|
298
298
|
destroy: e.destroy
|
|
299
299
|
});
|
|
300
300
|
}
|
|
301
|
-
function
|
|
301
|
+
function W(e, t) {
|
|
302
302
|
const {
|
|
303
303
|
resolve: o,
|
|
304
304
|
reject: i,
|
|
305
305
|
promise: r
|
|
306
|
-
} = new
|
|
307
|
-
let c =
|
|
306
|
+
} = new z.Deferred();
|
|
307
|
+
let c = S(!1);
|
|
308
308
|
function n(l) {
|
|
309
309
|
if (c.value === !0)
|
|
310
310
|
throw new Error("Agg already initialized");
|
|
@@ -318,41 +318,41 @@ function K(e, t) {
|
|
|
318
318
|
throw i(l), l;
|
|
319
319
|
})
|
|
320
320
|
);
|
|
321
|
-
const u =
|
|
321
|
+
const u = P(), f = u.run(
|
|
322
322
|
() => t({
|
|
323
323
|
getCurrentScope() {
|
|
324
324
|
return u;
|
|
325
325
|
},
|
|
326
|
-
onScopeDispose:
|
|
326
|
+
onScopeDispose: R,
|
|
327
327
|
onCreated(l) {
|
|
328
328
|
Promise.resolve().then(l);
|
|
329
329
|
},
|
|
330
330
|
onBeforeInitialize: n,
|
|
331
|
-
isInitialized:
|
|
331
|
+
isInitialized: E(() => c.value),
|
|
332
332
|
untilInitialized: r
|
|
333
333
|
})
|
|
334
|
-
), p =
|
|
334
|
+
), p = f.states || {}, a = f.commands || {}, d = f.events || {};
|
|
335
335
|
let m;
|
|
336
|
-
d.destroyed ? m = d.destroyed : (m =
|
|
337
|
-
let
|
|
338
|
-
return
|
|
336
|
+
d.destroyed ? m = d.destroyed : (m = O(), d.destroyed = m);
|
|
337
|
+
let w = f.destroy;
|
|
338
|
+
return w || (w = (() => {
|
|
339
339
|
m?.publish({});
|
|
340
340
|
for (const l in d) {
|
|
341
|
-
const
|
|
342
|
-
|
|
341
|
+
const x = d[l];
|
|
342
|
+
x.listeners.length = 0;
|
|
343
343
|
}
|
|
344
344
|
u.stop();
|
|
345
|
-
}),
|
|
346
|
-
__id:
|
|
345
|
+
})), I({
|
|
346
|
+
__id: g(),
|
|
347
347
|
type: "MultiInstance",
|
|
348
348
|
id: e,
|
|
349
|
-
api:
|
|
349
|
+
api: H({
|
|
350
350
|
states: p,
|
|
351
|
-
commands:
|
|
351
|
+
commands: a,
|
|
352
352
|
events: d,
|
|
353
|
-
destroy:
|
|
353
|
+
destroy: w
|
|
354
354
|
}),
|
|
355
|
-
isInitialized:
|
|
355
|
+
isInitialized: E(() => c.value),
|
|
356
356
|
async untilInitialized() {
|
|
357
357
|
return await r.catch((l) => {
|
|
358
358
|
throw new Error(`Failed to initialize Agg: ${l.message}
|
|
@@ -361,67 +361,67 @@ Stack : ${l.stack || "unkown"}`);
|
|
|
361
361
|
}
|
|
362
362
|
});
|
|
363
363
|
}
|
|
364
|
-
function
|
|
364
|
+
function G(e) {
|
|
365
365
|
const {
|
|
366
366
|
resolve: t,
|
|
367
367
|
reject: o,
|
|
368
368
|
promise: i
|
|
369
|
-
} = new
|
|
370
|
-
let r =
|
|
371
|
-
function c(
|
|
369
|
+
} = new z.Deferred();
|
|
370
|
+
let r = S(!1);
|
|
371
|
+
function c(a) {
|
|
372
372
|
if (r.value === !0)
|
|
373
373
|
throw new Error("Agg already initialized");
|
|
374
|
-
n.push(
|
|
374
|
+
n.push(a());
|
|
375
375
|
}
|
|
376
376
|
const n = [], s = e({
|
|
377
|
-
onCreated(
|
|
378
|
-
Promise.resolve().then(
|
|
377
|
+
onCreated(a) {
|
|
378
|
+
Promise.resolve().then(a);
|
|
379
379
|
},
|
|
380
380
|
onBeforeInitialize: c,
|
|
381
|
-
isInitialized:
|
|
381
|
+
isInitialized: E(() => r.value),
|
|
382
382
|
untilInitialized: i
|
|
383
383
|
});
|
|
384
384
|
setTimeout(
|
|
385
385
|
() => Promise.all(n).then(() => {
|
|
386
386
|
t(), r.value = !0;
|
|
387
|
-
}).catch((
|
|
388
|
-
o(
|
|
387
|
+
}).catch((a) => {
|
|
388
|
+
o(a);
|
|
389
389
|
}),
|
|
390
390
|
0
|
|
391
391
|
);
|
|
392
|
-
const u = s.states || {},
|
|
392
|
+
const u = s.states || {}, f = s.commands || {}, p = s.events || {};
|
|
393
393
|
return {
|
|
394
|
-
__id:
|
|
394
|
+
__id: g(),
|
|
395
395
|
type: "Singleton",
|
|
396
|
-
api:
|
|
396
|
+
api: V({
|
|
397
397
|
states: u,
|
|
398
|
-
commands:
|
|
398
|
+
commands: f,
|
|
399
399
|
events: p,
|
|
400
400
|
destroy: () => {
|
|
401
401
|
}
|
|
402
402
|
}),
|
|
403
|
-
isInitialized:
|
|
403
|
+
isInitialized: E(() => r.value),
|
|
404
404
|
async untilInitialized() {
|
|
405
|
-
return await i.catch((
|
|
406
|
-
throw new Error(`Failed to initialize Agg: ${
|
|
407
|
-
Stack : ${
|
|
405
|
+
return await i.catch((a) => {
|
|
406
|
+
throw new Error(`Failed to initialize Agg: ${a.message}
|
|
407
|
+
Stack : ${a.stack || "unkown"}`);
|
|
408
408
|
});
|
|
409
409
|
}
|
|
410
410
|
};
|
|
411
411
|
}
|
|
412
|
-
function
|
|
413
|
-
const i =
|
|
412
|
+
function U(e, t, o) {
|
|
413
|
+
const i = S(M(e));
|
|
414
414
|
if (!o?.forceSync)
|
|
415
|
-
return
|
|
415
|
+
return v(i, t, o), i;
|
|
416
416
|
o.forceSync = void 0;
|
|
417
417
|
let r;
|
|
418
|
-
return
|
|
418
|
+
return v(
|
|
419
419
|
e,
|
|
420
420
|
(c) => {
|
|
421
421
|
r = c, i.value = c;
|
|
422
422
|
},
|
|
423
423
|
o
|
|
424
|
-
),
|
|
424
|
+
), v(
|
|
425
425
|
i,
|
|
426
426
|
(c, n, s) => {
|
|
427
427
|
y(c, r) || t(c, n, s);
|
|
@@ -429,24 +429,49 @@ function G(e, t, o) {
|
|
|
429
429
|
o
|
|
430
430
|
), i;
|
|
431
431
|
}
|
|
432
|
-
function
|
|
432
|
+
function X(e, t, o) {
|
|
433
|
+
const i = T(M(e));
|
|
434
|
+
if (!o?.forceSync)
|
|
435
|
+
return v(i, t, o), i;
|
|
436
|
+
o.forceSync = void 0;
|
|
437
|
+
let r = !1;
|
|
438
|
+
return v(
|
|
439
|
+
e,
|
|
440
|
+
(c) => {
|
|
441
|
+
r = !0;
|
|
442
|
+
const n = Object.keys(c);
|
|
443
|
+
for (const s of n)
|
|
444
|
+
i[s] = c[s];
|
|
445
|
+
r = !1;
|
|
446
|
+
},
|
|
447
|
+
o
|
|
448
|
+
), v(
|
|
449
|
+
i,
|
|
450
|
+
(c, n, s) => {
|
|
451
|
+
r || t(c, n, s);
|
|
452
|
+
},
|
|
453
|
+
o
|
|
454
|
+
), i;
|
|
455
|
+
}
|
|
456
|
+
function M(e) {
|
|
433
457
|
let t;
|
|
434
458
|
if (typeof e == "function")
|
|
435
459
|
t = e();
|
|
436
|
-
else if (
|
|
437
|
-
t =
|
|
460
|
+
else if (D(e) || C(e))
|
|
461
|
+
t = N(e);
|
|
438
462
|
else
|
|
439
463
|
throw new Error("invalid state");
|
|
440
464
|
return typeof t == "object" && (t = _(t)), t;
|
|
441
465
|
}
|
|
442
466
|
export {
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
467
|
+
L as Utils,
|
|
468
|
+
X as bindReactive,
|
|
469
|
+
U as bindRef,
|
|
470
|
+
O as createBroadcastEvent,
|
|
471
|
+
W as createMultiInstanceAgg,
|
|
472
|
+
K as createPluginHelperByAgg,
|
|
473
|
+
q as createPluginHelperByAggCreator,
|
|
474
|
+
F as createRequestEvent,
|
|
475
|
+
G as createSingletonAgg
|
|
451
476
|
};
|
|
452
477
|
//# sourceMappingURL=index.mjs.map
|