@expressive/mvc 0.33.0 → 0.35.0-alpha.0
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.d.ts +312 -0
- package/dist/index.js +715 -0
- package/dist/index.mjs +681 -0
- package/package.json +12 -10
- package/lib/index.d.ts +0 -411
- package/lib/index.esm.js +0 -1052
- package/lib/index.js +0 -1065
package/lib/index.js
DELETED
|
@@ -1,1065 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
/******************************************************************************
|
|
6
|
-
Copyright (c) Microsoft Corporation.
|
|
7
|
-
|
|
8
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
9
|
-
purpose with or without fee is hereby granted.
|
|
10
|
-
|
|
11
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
12
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
13
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
14
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
15
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
16
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
17
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
18
|
-
***************************************************************************** */
|
|
19
|
-
|
|
20
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
21
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
22
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
23
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
24
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
25
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
26
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
class Issue extends Error {
|
|
31
|
-
constructor() {
|
|
32
|
-
super(...arguments);
|
|
33
|
-
// drop first line (error factory) in stack trace.
|
|
34
|
-
this.stack = this.stack.replace(/\n.+/, "");
|
|
35
|
-
}
|
|
36
|
-
warn() {
|
|
37
|
-
console.warn(this.message);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
function issues(register) {
|
|
41
|
-
const Library = {};
|
|
42
|
-
for (const name in register)
|
|
43
|
-
Library[name] = (...args) => new Issue(register[name].apply(null, args));
|
|
44
|
-
return Library;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
const { assign, create, defineProperties, defineProperty, entries, keys, getPrototypeOf, getOwnPropertyDescriptor, getOwnPropertySymbols, values } = Object;
|
|
48
|
-
|
|
49
|
-
const Oops$8 = issues({
|
|
50
|
-
NotFound: (name) => `Could not find ${name} in context.`
|
|
51
|
-
});
|
|
52
|
-
function get$1(argument) {
|
|
53
|
-
return Control.get((dispatch, context) => {
|
|
54
|
-
const refresh = () => dispatch(x => x + 1);
|
|
55
|
-
let onUpdate;
|
|
56
|
-
let value;
|
|
57
|
-
if (typeof argument !== "function") {
|
|
58
|
-
const got = context.get(this);
|
|
59
|
-
if (got)
|
|
60
|
-
value = argument === undefined
|
|
61
|
-
? Control.watch(got, k => k ? onUpdate : undefined)
|
|
62
|
-
: got;
|
|
63
|
-
else if (argument !== false)
|
|
64
|
-
throw Oops$8.NotFound(this);
|
|
65
|
-
return {
|
|
66
|
-
mount() {
|
|
67
|
-
onUpdate = refresh;
|
|
68
|
-
return () => onUpdate = null;
|
|
69
|
-
},
|
|
70
|
-
render: () => value
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
let compute = argument;
|
|
74
|
-
let suspense;
|
|
75
|
-
let getValue;
|
|
76
|
-
let factory;
|
|
77
|
-
let proxy;
|
|
78
|
-
const found = context.get(this);
|
|
79
|
-
if (!found)
|
|
80
|
-
throw Oops$8.NotFound(this);
|
|
81
|
-
function forceUpdate(action) {
|
|
82
|
-
if (typeof action == "function")
|
|
83
|
-
action = action();
|
|
84
|
-
if (getValue)
|
|
85
|
-
didUpdate(getValue());
|
|
86
|
-
else
|
|
87
|
-
refresh();
|
|
88
|
-
if (action)
|
|
89
|
-
return action.finally(refresh);
|
|
90
|
-
}
|
|
91
|
-
function didUpdate(got) {
|
|
92
|
-
value = got;
|
|
93
|
-
if (suspense) {
|
|
94
|
-
suspense();
|
|
95
|
-
suspense = undefined;
|
|
96
|
-
}
|
|
97
|
-
else
|
|
98
|
-
refresh();
|
|
99
|
-
}
|
|
100
|
-
proxy = Control.watch(found, () => factory ? null : onUpdate);
|
|
101
|
-
getValue = () => compute.call(proxy, proxy, forceUpdate);
|
|
102
|
-
value = getValue();
|
|
103
|
-
if (value === null) {
|
|
104
|
-
getValue = undefined;
|
|
105
|
-
onUpdate = null;
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
if (typeof value == "function") {
|
|
109
|
-
const get = value;
|
|
110
|
-
Control.watch(proxy, () => onUpdate);
|
|
111
|
-
factory = true;
|
|
112
|
-
compute = () => get();
|
|
113
|
-
value = get();
|
|
114
|
-
}
|
|
115
|
-
if (value instanceof Promise) {
|
|
116
|
-
onUpdate = null;
|
|
117
|
-
value.then(didUpdate);
|
|
118
|
-
value = undefined;
|
|
119
|
-
}
|
|
120
|
-
else
|
|
121
|
-
onUpdate = () => {
|
|
122
|
-
const next = getValue();
|
|
123
|
-
if (value !== next)
|
|
124
|
-
didUpdate(next);
|
|
125
|
-
};
|
|
126
|
-
return {
|
|
127
|
-
mount: () => () => {
|
|
128
|
-
onUpdate = null;
|
|
129
|
-
},
|
|
130
|
-
render: () => {
|
|
131
|
-
if (value !== undefined)
|
|
132
|
-
return value;
|
|
133
|
-
if (onUpdate)
|
|
134
|
-
return null;
|
|
135
|
-
throw new Promise(res => {
|
|
136
|
-
suspense = res;
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
};
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
function use$1(apply, repeat) {
|
|
144
|
-
const render = Control.use(dispatch => {
|
|
145
|
-
const instance = this.new();
|
|
146
|
-
const local = Control.watch(instance, () => onUpdate);
|
|
147
|
-
const refresh = () => dispatch(x => x + 1);
|
|
148
|
-
let onUpdate;
|
|
149
|
-
let shouldApply = !!apply;
|
|
150
|
-
return {
|
|
151
|
-
instance,
|
|
152
|
-
mount() {
|
|
153
|
-
onUpdate = refresh;
|
|
154
|
-
return () => {
|
|
155
|
-
onUpdate = null;
|
|
156
|
-
instance.null();
|
|
157
|
-
};
|
|
158
|
-
},
|
|
159
|
-
render(props) {
|
|
160
|
-
if (shouldApply) {
|
|
161
|
-
onUpdate = undefined;
|
|
162
|
-
if (typeof props == "function")
|
|
163
|
-
props(instance);
|
|
164
|
-
else if (props)
|
|
165
|
-
for (const key in instance)
|
|
166
|
-
if (props.hasOwnProperty(key))
|
|
167
|
-
instance[key] = props[key];
|
|
168
|
-
if (!repeat)
|
|
169
|
-
shouldApply = false;
|
|
170
|
-
instance.set(0).then(() => onUpdate = refresh);
|
|
171
|
-
}
|
|
172
|
-
return local;
|
|
173
|
-
}
|
|
174
|
-
};
|
|
175
|
-
});
|
|
176
|
-
return render(apply);
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
const Oops$7 = issues({
|
|
180
|
-
NotReady: (model, key) => `Value ${model}.${key} value is not yet available.`,
|
|
181
|
-
Destoryed: () => "Model is destroyed."
|
|
182
|
-
});
|
|
183
|
-
function suspense(source, key) {
|
|
184
|
-
const error = Oops$7.NotReady(source.subject, key);
|
|
185
|
-
const watch = source.observers.get(key);
|
|
186
|
-
const promise = new Promise((resolve, reject) => {
|
|
187
|
-
function onUpdate(key) {
|
|
188
|
-
if (key)
|
|
189
|
-
return () => {
|
|
190
|
-
if (source.state[key] !== undefined) {
|
|
191
|
-
watch.delete(onUpdate);
|
|
192
|
-
resolve();
|
|
193
|
-
}
|
|
194
|
-
};
|
|
195
|
-
if (key === null)
|
|
196
|
-
reject(Oops$7.Destoryed());
|
|
197
|
-
}
|
|
198
|
-
watch.add(onUpdate);
|
|
199
|
-
});
|
|
200
|
-
return assign(promise, {
|
|
201
|
-
toString: () => String(error),
|
|
202
|
-
name: "Suspense",
|
|
203
|
-
message: error.message,
|
|
204
|
-
stack: error.stack
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
|
-
function mayRetry(fn) {
|
|
208
|
-
const retry = (err) => {
|
|
209
|
-
if (err instanceof Promise)
|
|
210
|
-
return err.then(compute);
|
|
211
|
-
else
|
|
212
|
-
throw err;
|
|
213
|
-
};
|
|
214
|
-
const compute = () => {
|
|
215
|
-
try {
|
|
216
|
-
const output = fn();
|
|
217
|
-
return output instanceof Promise
|
|
218
|
-
? output.catch(retry)
|
|
219
|
-
: output;
|
|
220
|
-
}
|
|
221
|
-
catch (err) {
|
|
222
|
-
return retry(err);
|
|
223
|
-
}
|
|
224
|
-
};
|
|
225
|
-
return compute();
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
const Oops$6 = issues({
|
|
229
|
-
BadCallback: () => `Callback for effect-callback may only return a function.`
|
|
230
|
-
});
|
|
231
|
-
function createEffect(source, callback) {
|
|
232
|
-
return control(source, self => {
|
|
233
|
-
let { subject } = self;
|
|
234
|
-
let unSet;
|
|
235
|
-
let busy = false;
|
|
236
|
-
function invoke() {
|
|
237
|
-
if (busy)
|
|
238
|
-
return;
|
|
239
|
-
const output = mayRetry(() => {
|
|
240
|
-
if (typeof unSet == "function")
|
|
241
|
-
unSet();
|
|
242
|
-
unSet = callback.call(subject, subject);
|
|
243
|
-
if (unSet instanceof Promise)
|
|
244
|
-
unSet = undefined;
|
|
245
|
-
if (unSet && typeof unSet !== "function")
|
|
246
|
-
throw Oops$6.BadCallback();
|
|
247
|
-
});
|
|
248
|
-
if (output instanceof Promise) {
|
|
249
|
-
output.finally(() => busy = false);
|
|
250
|
-
busy = true;
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
let refresh;
|
|
254
|
-
subject = watch(subject, () => refresh);
|
|
255
|
-
self.followers.add(key => (key === null || refresh === null ? refresh : undefined));
|
|
256
|
-
invoke();
|
|
257
|
-
refresh = invoke;
|
|
258
|
-
return () => refresh = null;
|
|
259
|
-
});
|
|
260
|
-
}
|
|
261
|
-
function createValueEffect(callback, ignoreNull) {
|
|
262
|
-
let unSet;
|
|
263
|
-
return function (value) {
|
|
264
|
-
if (typeof unSet == "function")
|
|
265
|
-
unSet = void unSet(value);
|
|
266
|
-
if (value === null && ignoreNull)
|
|
267
|
-
return;
|
|
268
|
-
const out = callback.call(this, value);
|
|
269
|
-
if (typeof out == "boolean")
|
|
270
|
-
return out;
|
|
271
|
-
if (!out || out instanceof Promise)
|
|
272
|
-
return;
|
|
273
|
-
if (typeof out == "function")
|
|
274
|
-
unSet = out;
|
|
275
|
-
else
|
|
276
|
-
throw Oops$6.BadCallback();
|
|
277
|
-
};
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
function getMethod(argument, callback, once) {
|
|
281
|
-
if (typeof argument == "function")
|
|
282
|
-
return createEffect(this, argument);
|
|
283
|
-
const self = control(this, true);
|
|
284
|
-
function get(key) {
|
|
285
|
-
const value = self.state[key];
|
|
286
|
-
return value instanceof Model ? value.get() : value;
|
|
287
|
-
}
|
|
288
|
-
const extract = typeof argument == "string"
|
|
289
|
-
? () => get(argument)
|
|
290
|
-
: () => {
|
|
291
|
-
const output = {};
|
|
292
|
-
for (const key of argument || keys(self.state))
|
|
293
|
-
output[key] = get(key);
|
|
294
|
-
return output;
|
|
295
|
-
};
|
|
296
|
-
if (typeof callback != "function")
|
|
297
|
-
return extract();
|
|
298
|
-
const select = typeof argument == "string" ? [argument] : argument;
|
|
299
|
-
const invoke = () => callback(extract(), self.latest || []);
|
|
300
|
-
if (select)
|
|
301
|
-
for (const key of select)
|
|
302
|
-
try {
|
|
303
|
-
const value = self.subject[key];
|
|
304
|
-
if (!(key in self.state))
|
|
305
|
-
self.watch(key, { value });
|
|
306
|
-
}
|
|
307
|
-
catch (e) {
|
|
308
|
-
// TODO: should this be caught?
|
|
309
|
-
}
|
|
310
|
-
if (once === undefined)
|
|
311
|
-
invoke();
|
|
312
|
-
const remove = self.addListener(key => {
|
|
313
|
-
if (!select || select.includes(key)) {
|
|
314
|
-
if (once)
|
|
315
|
-
remove();
|
|
316
|
-
return invoke;
|
|
317
|
-
}
|
|
318
|
-
});
|
|
319
|
-
return remove;
|
|
320
|
-
}
|
|
321
|
-
function setMethod(arg1, arg2) {
|
|
322
|
-
const self = control(this, true);
|
|
323
|
-
const { state } = self;
|
|
324
|
-
let timeout = 0;
|
|
325
|
-
switch (typeof arg1) {
|
|
326
|
-
case "string":
|
|
327
|
-
if (1 in arguments)
|
|
328
|
-
if (arg1 in state)
|
|
329
|
-
state[arg1] = arg2;
|
|
330
|
-
else
|
|
331
|
-
self.watch(arg1, { value: arg2 });
|
|
332
|
-
self.update(arg1);
|
|
333
|
-
break;
|
|
334
|
-
case "object":
|
|
335
|
-
for (const key in state)
|
|
336
|
-
if (key in arg1 && (!arg2 || arg2.includes(key))) {
|
|
337
|
-
state[key] = arg1[key];
|
|
338
|
-
self.update(key);
|
|
339
|
-
}
|
|
340
|
-
break;
|
|
341
|
-
default:
|
|
342
|
-
timeout = arg1;
|
|
343
|
-
}
|
|
344
|
-
return new Promise((resolve) => {
|
|
345
|
-
if (!self.frame.size && timeout === 0)
|
|
346
|
-
resolve(false);
|
|
347
|
-
const remove = self.addListener(() => {
|
|
348
|
-
remove();
|
|
349
|
-
return () => resolve(self.latest);
|
|
350
|
-
});
|
|
351
|
-
if (timeout > 0)
|
|
352
|
-
setTimeout(() => {
|
|
353
|
-
remove();
|
|
354
|
-
resolve(false);
|
|
355
|
-
}, timeout);
|
|
356
|
-
});
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
class Model {
|
|
360
|
-
constructor(id) {
|
|
361
|
-
new Control(this, id === undefined ? uid() : id);
|
|
362
|
-
}
|
|
363
|
-
/** Mark this instance for garbage collection. */
|
|
364
|
-
null() {
|
|
365
|
-
control(this, true).clear();
|
|
366
|
-
}
|
|
367
|
-
/**
|
|
368
|
-
* Creates a new instance of this controller.
|
|
369
|
-
*
|
|
370
|
-
* Beyond `new this(...)`, method will activate managed-state.
|
|
371
|
-
*
|
|
372
|
-
* @param args - arguments sent to constructor
|
|
373
|
-
*/
|
|
374
|
-
static new(...args) {
|
|
375
|
-
const instance = new this(...args);
|
|
376
|
-
control(instance, true);
|
|
377
|
-
return instance;
|
|
378
|
-
}
|
|
379
|
-
/**
|
|
380
|
-
* Static equivalent of `x instanceof this`.
|
|
381
|
-
*
|
|
382
|
-
* Will determine if provided class is a subtype of this one.
|
|
383
|
-
*/
|
|
384
|
-
static is(maybe) {
|
|
385
|
-
return (typeof maybe == "function" &&
|
|
386
|
-
maybe.prototype instanceof this);
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
Model.get = get$1;
|
|
390
|
-
Model.use = use$1;
|
|
391
|
-
defineProperty(Model, "toString", {
|
|
392
|
-
value() {
|
|
393
|
-
return this.name;
|
|
394
|
-
}
|
|
395
|
-
});
|
|
396
|
-
defineProperties(Model.prototype, {
|
|
397
|
-
get: { value: getMethod },
|
|
398
|
-
set: { value: setMethod },
|
|
399
|
-
toString: {
|
|
400
|
-
configurable: true,
|
|
401
|
-
value() {
|
|
402
|
-
return `${this.constructor.name}-${control(this).id}`;
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
});
|
|
406
|
-
/* TODO: Remove below on 1.0.0 release. */
|
|
407
|
-
defineProperty(Model, "isTypeof", {
|
|
408
|
-
get() {
|
|
409
|
-
throw new Error("Model.isTypeof method was renamed. Use Model.is instead.");
|
|
410
|
-
}
|
|
411
|
-
});
|
|
412
|
-
defineProperties(Model.prototype, {
|
|
413
|
-
is: {
|
|
414
|
-
configurable: true,
|
|
415
|
-
get() {
|
|
416
|
-
throw new Error("Model.is property is now is only available from a hook.");
|
|
417
|
-
}
|
|
418
|
-
},
|
|
419
|
-
on: {
|
|
420
|
-
configurable: true,
|
|
421
|
-
writable: true,
|
|
422
|
-
value() {
|
|
423
|
-
throw new Error("Model.on() is deprecated. Use Model.get or Model.set instead.");
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
});
|
|
427
|
-
/** Random alphanumberic of length 6. Will always start with a letter. */
|
|
428
|
-
function uid() {
|
|
429
|
-
return (Math.random() * 0.722 + 0.278).toString(36).substring(2, 8).toUpperCase();
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
const Oops$5 = issues({
|
|
433
|
-
BadAssignment: (parent, expected, got) => `${parent} expected Model of type ${expected} but got ${got}.`,
|
|
434
|
-
});
|
|
435
|
-
const REGISTER = new WeakMap();
|
|
436
|
-
const OBSERVER = new WeakMap();
|
|
437
|
-
const INSTRUCT = new Map();
|
|
438
|
-
const PENDING$1 = new WeakMap();
|
|
439
|
-
const PARENTS = new WeakMap();
|
|
440
|
-
class Control {
|
|
441
|
-
constructor(subject, id) {
|
|
442
|
-
this.state = {};
|
|
443
|
-
this.frame = new Set();
|
|
444
|
-
this.followers = new Set();
|
|
445
|
-
this.observers = new Map([["", this.followers]]);
|
|
446
|
-
this.id = id;
|
|
447
|
-
this.subject = subject;
|
|
448
|
-
REGISTER.set(subject, this);
|
|
449
|
-
if (id !== false)
|
|
450
|
-
PENDING$1.set(this, new Set(Control.ready));
|
|
451
|
-
}
|
|
452
|
-
add(key) {
|
|
453
|
-
const { value } = getOwnPropertyDescriptor(this.subject, key);
|
|
454
|
-
const instruction = INSTRUCT.get(value);
|
|
455
|
-
if (typeof instruction == "function") {
|
|
456
|
-
INSTRUCT.delete(value);
|
|
457
|
-
instruction(this, key);
|
|
458
|
-
}
|
|
459
|
-
else if (value instanceof Model)
|
|
460
|
-
setRecursive(this, key, value);
|
|
461
|
-
else
|
|
462
|
-
this.watch(key, { value });
|
|
463
|
-
}
|
|
464
|
-
watch(key, output) {
|
|
465
|
-
const { state } = this;
|
|
466
|
-
const { set, enumerable = true } = output;
|
|
467
|
-
const subs = new Set();
|
|
468
|
-
this.observers.set(key, subs);
|
|
469
|
-
if ("value" in output)
|
|
470
|
-
state[key] = output.value;
|
|
471
|
-
defineProperty(this.subject, key, {
|
|
472
|
-
enumerable,
|
|
473
|
-
set: set === false
|
|
474
|
-
? undefined
|
|
475
|
-
: this.ref(key, set),
|
|
476
|
-
get() {
|
|
477
|
-
const event = OBSERVER.get(this);
|
|
478
|
-
if (event)
|
|
479
|
-
subs.add(event);
|
|
480
|
-
const value = output.get
|
|
481
|
-
? output.get(this) : state[key];
|
|
482
|
-
return event && REGISTER.has(value)
|
|
483
|
-
? watch(value, event)
|
|
484
|
-
: value;
|
|
485
|
-
}
|
|
486
|
-
});
|
|
487
|
-
}
|
|
488
|
-
ref(key, callback) {
|
|
489
|
-
const { state, subject } = this;
|
|
490
|
-
return (value) => {
|
|
491
|
-
if (value !== state[key])
|
|
492
|
-
switch (callback && callback.call(subject, value)) {
|
|
493
|
-
case undefined:
|
|
494
|
-
state[key] = value;
|
|
495
|
-
case true:
|
|
496
|
-
this.update(key);
|
|
497
|
-
}
|
|
498
|
-
};
|
|
499
|
-
}
|
|
500
|
-
update(key) {
|
|
501
|
-
const { frame } = this;
|
|
502
|
-
if (frame.has(key))
|
|
503
|
-
return;
|
|
504
|
-
if (!frame.size) {
|
|
505
|
-
this.latest = undefined;
|
|
506
|
-
requestUpdateFrame(() => {
|
|
507
|
-
this.latest = Array.from(frame);
|
|
508
|
-
this.followers.forEach(cb => {
|
|
509
|
-
const notify = cb(undefined, this);
|
|
510
|
-
if (notify)
|
|
511
|
-
requestUpdateFrame(notify);
|
|
512
|
-
});
|
|
513
|
-
frame.clear();
|
|
514
|
-
});
|
|
515
|
-
}
|
|
516
|
-
frame.add(key);
|
|
517
|
-
for (const k of ["", key]) {
|
|
518
|
-
const subs = this.observers.get(k);
|
|
519
|
-
subs && subs.forEach(cb => {
|
|
520
|
-
const notify = cb(key, this);
|
|
521
|
-
if (notify === null)
|
|
522
|
-
subs.delete(cb);
|
|
523
|
-
else if (notify)
|
|
524
|
-
requestUpdateFrame(notify);
|
|
525
|
-
});
|
|
526
|
-
}
|
|
527
|
-
}
|
|
528
|
-
addListener(fn) {
|
|
529
|
-
this.followers.add(fn);
|
|
530
|
-
return () => this.followers.delete(fn);
|
|
531
|
-
}
|
|
532
|
-
clear() {
|
|
533
|
-
this.observers.forEach(subs => {
|
|
534
|
-
subs.forEach(fn => {
|
|
535
|
-
const cb = fn(null, this);
|
|
536
|
-
cb && cb();
|
|
537
|
-
});
|
|
538
|
-
});
|
|
539
|
-
this.observers.clear();
|
|
540
|
-
}
|
|
541
|
-
}
|
|
542
|
-
Control.ready = new Set();
|
|
543
|
-
Control.after = new Set();
|
|
544
|
-
Control.before = new Set();
|
|
545
|
-
Control.pending = new Set();
|
|
546
|
-
Control.for = control;
|
|
547
|
-
Control.apply = apply;
|
|
548
|
-
Control.watch = watch;
|
|
549
|
-
function control(subject, ready) {
|
|
550
|
-
const control = REGISTER.get(subject);
|
|
551
|
-
const pending = PENDING$1.get(control);
|
|
552
|
-
if (typeof ready == "function") {
|
|
553
|
-
if (!pending)
|
|
554
|
-
return ready(control);
|
|
555
|
-
let done;
|
|
556
|
-
pending.add(() => done = ready(control));
|
|
557
|
-
return () => done && done();
|
|
558
|
-
}
|
|
559
|
-
if (pending && ready) {
|
|
560
|
-
for (const key in control.subject)
|
|
561
|
-
control.add(key);
|
|
562
|
-
PENDING$1.delete(control);
|
|
563
|
-
pending.forEach(cb => cb(control));
|
|
564
|
-
}
|
|
565
|
-
return control;
|
|
566
|
-
}
|
|
567
|
-
function requestUpdateFrame(event) {
|
|
568
|
-
const { after, before, pending } = Control;
|
|
569
|
-
if (!pending.size)
|
|
570
|
-
setTimeout(() => {
|
|
571
|
-
before.forEach(x => x());
|
|
572
|
-
pending.forEach(notify => {
|
|
573
|
-
try {
|
|
574
|
-
notify();
|
|
575
|
-
}
|
|
576
|
-
catch (err) {
|
|
577
|
-
console.error(err);
|
|
578
|
-
}
|
|
579
|
-
});
|
|
580
|
-
pending.clear();
|
|
581
|
-
after.forEach(x => x());
|
|
582
|
-
}, 0);
|
|
583
|
-
pending.add(event);
|
|
584
|
-
}
|
|
585
|
-
function setRecursive(on, key, value) {
|
|
586
|
-
const set = (next) => {
|
|
587
|
-
if (next instanceof value.constructor) {
|
|
588
|
-
on.state[key] = next;
|
|
589
|
-
parent(next, on.subject);
|
|
590
|
-
control(next, true);
|
|
591
|
-
return true;
|
|
592
|
-
}
|
|
593
|
-
throw Oops$5.BadAssignment(`${on.subject}.${key}`, value.constructor, next);
|
|
594
|
-
};
|
|
595
|
-
on.watch(key, { set });
|
|
596
|
-
set(value);
|
|
597
|
-
}
|
|
598
|
-
function parent(child, assign) {
|
|
599
|
-
if (!assign)
|
|
600
|
-
return PARENTS.get(child);
|
|
601
|
-
PARENTS.set(child, assign);
|
|
602
|
-
}
|
|
603
|
-
function watch(value, cb) {
|
|
604
|
-
if (!OBSERVER.has(value)) {
|
|
605
|
-
const control = REGISTER.get(value);
|
|
606
|
-
value = defineProperty(create(value), "is", { value });
|
|
607
|
-
REGISTER.set(value, control);
|
|
608
|
-
}
|
|
609
|
-
OBSERVER.set(value, cb);
|
|
610
|
-
return value;
|
|
611
|
-
}
|
|
612
|
-
function apply(instruction) {
|
|
613
|
-
const placeholder = Symbol("instruction");
|
|
614
|
-
INSTRUCT.set(placeholder, (onto, key) => {
|
|
615
|
-
delete onto.subject[key];
|
|
616
|
-
const output = instruction.call(onto, key, onto);
|
|
617
|
-
if (output)
|
|
618
|
-
onto.watch(key, typeof output == "function" ? { get: output } : output);
|
|
619
|
-
});
|
|
620
|
-
return placeholder;
|
|
621
|
-
}
|
|
622
|
-
|
|
623
|
-
const Oops$4 = issues({
|
|
624
|
-
DuplicatePending: (key) => `Invoked action ${key} but one is already active.`
|
|
625
|
-
});
|
|
626
|
-
function run(task) {
|
|
627
|
-
return apply((key, control) => {
|
|
628
|
-
let pending = false;
|
|
629
|
-
const invoke = (...args) => __awaiter(this, void 0, void 0, function* () {
|
|
630
|
-
if (pending)
|
|
631
|
-
return Promise.reject(Oops$4.DuplicatePending(key));
|
|
632
|
-
pending = true;
|
|
633
|
-
control.update(key);
|
|
634
|
-
try {
|
|
635
|
-
return yield mayRetry(() => (task.apply(control.subject, args)));
|
|
636
|
-
}
|
|
637
|
-
finally {
|
|
638
|
-
pending = false;
|
|
639
|
-
control.update(key);
|
|
640
|
-
}
|
|
641
|
-
});
|
|
642
|
-
control.state[key] = undefined;
|
|
643
|
-
defineProperty(invoke, "active", {
|
|
644
|
-
get: () => pending
|
|
645
|
-
});
|
|
646
|
-
return {
|
|
647
|
-
value: invoke,
|
|
648
|
-
set: false
|
|
649
|
-
};
|
|
650
|
-
});
|
|
651
|
-
}
|
|
652
|
-
|
|
653
|
-
const Oops$3 = issues({
|
|
654
|
-
PeerNotAllowed: (model, property) => `Attempted to use an instruction result (probably use or get) as computed source for ${model}.${property}. This is not allowed.`,
|
|
655
|
-
Failed: (parent, property, initial) => `An exception was thrown while ${initial ? "initializing" : "refreshing"} ${parent}.${property}.`,
|
|
656
|
-
Required: (expects, child) => `New ${child} created standalone but requires parent of type ${expects}.`,
|
|
657
|
-
Unexpected: (expects, child, got) => `New ${child} created as child of ${got}, but must be instanceof ${expects}.`,
|
|
658
|
-
AmbientRequired: (requested, requester) => `Attempted to find an instance of ${requested} in context. It is required by ${requester}, but one could not be found.`
|
|
659
|
-
});
|
|
660
|
-
function get(arg0, arg1) {
|
|
661
|
-
return apply((key, control) => {
|
|
662
|
-
let { subject } = control;
|
|
663
|
-
if (typeof arg0 == "symbol")
|
|
664
|
-
throw Oops$3.PeerNotAllowed(subject, key);
|
|
665
|
-
let source = cb => cb(subject);
|
|
666
|
-
if (arg0 instanceof Model)
|
|
667
|
-
subject = arg0;
|
|
668
|
-
else if (Model.is(arg0)) {
|
|
669
|
-
const hasParent = parent(subject);
|
|
670
|
-
if (!hasParent) {
|
|
671
|
-
if (arg1 === true)
|
|
672
|
-
throw Oops$3.Required(arg0, subject);
|
|
673
|
-
const fetch = Control.has(subject);
|
|
674
|
-
source = got => {
|
|
675
|
-
fetch(context => {
|
|
676
|
-
const model = context.get(arg0);
|
|
677
|
-
if (model)
|
|
678
|
-
got(model);
|
|
679
|
-
else if (arg1 !== false)
|
|
680
|
-
throw Oops$3.AmbientRequired(arg0, subject);
|
|
681
|
-
});
|
|
682
|
-
};
|
|
683
|
-
}
|
|
684
|
-
else if (!arg0 || hasParent instanceof arg0)
|
|
685
|
-
subject = hasParent;
|
|
686
|
-
else
|
|
687
|
-
throw Oops$3.Unexpected(arg0, subject, hasParent);
|
|
688
|
-
}
|
|
689
|
-
else if (typeof arg0 == "function")
|
|
690
|
-
arg1 = arg0.call(subject, key, subject);
|
|
691
|
-
return typeof arg1 == "function"
|
|
692
|
-
? computed(control, key, source, arg1)
|
|
693
|
-
: recursive(control, key, source, arg1);
|
|
694
|
-
});
|
|
695
|
-
}
|
|
696
|
-
function recursive(parent, key, source, required) {
|
|
697
|
-
let waiting;
|
|
698
|
-
if (source)
|
|
699
|
-
source((got) => {
|
|
700
|
-
parent.state[key] = got;
|
|
701
|
-
if (waiting)
|
|
702
|
-
parent.update(key);
|
|
703
|
-
});
|
|
704
|
-
waiting = true;
|
|
705
|
-
return () => {
|
|
706
|
-
const value = parent.state[key];
|
|
707
|
-
if (value)
|
|
708
|
-
return value;
|
|
709
|
-
if (required !== false)
|
|
710
|
-
throw suspense(parent, key);
|
|
711
|
-
};
|
|
712
|
-
}
|
|
713
|
-
const ORDER = new WeakMap();
|
|
714
|
-
const PENDING = new Set();
|
|
715
|
-
let OFFSET = 0;
|
|
716
|
-
function computed(parent, key, source, setter) {
|
|
717
|
-
const { state } = parent;
|
|
718
|
-
let proxy;
|
|
719
|
-
let active;
|
|
720
|
-
let isAsync;
|
|
721
|
-
let reset;
|
|
722
|
-
function compute(initial) {
|
|
723
|
-
if (parent.frame.has(key))
|
|
724
|
-
return;
|
|
725
|
-
let next;
|
|
726
|
-
try {
|
|
727
|
-
next = setter.call(proxy, proxy);
|
|
728
|
-
}
|
|
729
|
-
catch (err) {
|
|
730
|
-
Oops$3.Failed(parent.subject, key, initial).warn();
|
|
731
|
-
if (initial)
|
|
732
|
-
throw err;
|
|
733
|
-
console.error(err);
|
|
734
|
-
}
|
|
735
|
-
if (next !== state[key]) {
|
|
736
|
-
state[key] = next;
|
|
737
|
-
if (!initial || isAsync)
|
|
738
|
-
parent.update(key);
|
|
739
|
-
}
|
|
740
|
-
}
|
|
741
|
-
function connect(model) {
|
|
742
|
-
if (reset)
|
|
743
|
-
reset();
|
|
744
|
-
let done;
|
|
745
|
-
reset = () => done = true;
|
|
746
|
-
proxy = watch(model, (_, control) => {
|
|
747
|
-
if (done)
|
|
748
|
-
return null;
|
|
749
|
-
if (control !== parent)
|
|
750
|
-
compute();
|
|
751
|
-
else
|
|
752
|
-
PENDING.add(compute);
|
|
753
|
-
});
|
|
754
|
-
try {
|
|
755
|
-
compute(true);
|
|
756
|
-
}
|
|
757
|
-
finally {
|
|
758
|
-
ORDER.set(compute, OFFSET++);
|
|
759
|
-
}
|
|
760
|
-
}
|
|
761
|
-
return () => {
|
|
762
|
-
if (!active) {
|
|
763
|
-
active = true;
|
|
764
|
-
source(connect);
|
|
765
|
-
isAsync = true;
|
|
766
|
-
}
|
|
767
|
-
if (!proxy)
|
|
768
|
-
throw suspense(parent, key);
|
|
769
|
-
if (PENDING.delete(compute))
|
|
770
|
-
compute();
|
|
771
|
-
return state[key];
|
|
772
|
-
};
|
|
773
|
-
}
|
|
774
|
-
function flushComputed() {
|
|
775
|
-
while (PENDING.size) {
|
|
776
|
-
let compute;
|
|
777
|
-
for (const item of PENDING)
|
|
778
|
-
if (!compute || ORDER.get(item) < ORDER.get(compute))
|
|
779
|
-
compute = item;
|
|
780
|
-
PENDING.delete(compute);
|
|
781
|
-
compute();
|
|
782
|
-
}
|
|
783
|
-
}
|
|
784
|
-
Control.before.add(flushComputed);
|
|
785
|
-
|
|
786
|
-
const Oops$2 = issues({
|
|
787
|
-
BadRefObject: () => `ref instruction does not support object which is not 'this'`
|
|
788
|
-
});
|
|
789
|
-
function ref(arg, arg2) {
|
|
790
|
-
return apply((key, source) => {
|
|
791
|
-
let value = {};
|
|
792
|
-
if (typeof arg != "object")
|
|
793
|
-
value = createRef(source, key, arg && createValueEffect(arg, arg2 !== false));
|
|
794
|
-
else if (arg !== source.subject)
|
|
795
|
-
throw Oops$2.BadRefObject();
|
|
796
|
-
else
|
|
797
|
-
for (const key in source.state)
|
|
798
|
-
defineProperty(value, key, typeof arg2 == "function" ? {
|
|
799
|
-
configurable: true,
|
|
800
|
-
get() {
|
|
801
|
-
const out = arg2(key);
|
|
802
|
-
defineProperty(value, key, { value: out });
|
|
803
|
-
return out;
|
|
804
|
-
}
|
|
805
|
-
} : {
|
|
806
|
-
value: createRef(source, key)
|
|
807
|
-
});
|
|
808
|
-
source.state[key] = undefined;
|
|
809
|
-
source.observers.set(key, new Set());
|
|
810
|
-
defineProperty(source.subject, key, { value });
|
|
811
|
-
});
|
|
812
|
-
}
|
|
813
|
-
function createRef(src, key, cb) {
|
|
814
|
-
const refObjectFunction = src.ref(key, cb);
|
|
815
|
-
defineProperty(refObjectFunction, "current", {
|
|
816
|
-
set: refObjectFunction,
|
|
817
|
-
get: () => src.state[key]
|
|
818
|
-
});
|
|
819
|
-
return refObjectFunction;
|
|
820
|
-
}
|
|
821
|
-
|
|
822
|
-
const Oops$1 = issues({
|
|
823
|
-
ComputeFailed: (model, key) => `Generating initial value for ${model}.${key} failed.`,
|
|
824
|
-
NotReady: (model, key) => `Value ${model}.${key} value is not yet available.`
|
|
825
|
-
});
|
|
826
|
-
function set(value, argument) {
|
|
827
|
-
return apply((key, control) => {
|
|
828
|
-
const { state, subject } = control;
|
|
829
|
-
if (typeof value == "function" || value instanceof Promise) {
|
|
830
|
-
const output = {};
|
|
831
|
-
const init = () => {
|
|
832
|
-
try {
|
|
833
|
-
if (typeof value == "function")
|
|
834
|
-
value = mayRetry(value.bind(subject, key, subject));
|
|
835
|
-
if (value instanceof Promise) {
|
|
836
|
-
const pending = value
|
|
837
|
-
.then(value => {
|
|
838
|
-
output.get = undefined;
|
|
839
|
-
state[key] = value;
|
|
840
|
-
return value;
|
|
841
|
-
})
|
|
842
|
-
.catch(err => {
|
|
843
|
-
output.get = () => { throw err; };
|
|
844
|
-
})
|
|
845
|
-
.finally(() => {
|
|
846
|
-
control.update(key);
|
|
847
|
-
});
|
|
848
|
-
if (argument !== false)
|
|
849
|
-
return () => {
|
|
850
|
-
const { message, stack } = Oops$1.NotReady(subject, key);
|
|
851
|
-
throw assign(pending, { message, stack });
|
|
852
|
-
};
|
|
853
|
-
}
|
|
854
|
-
else
|
|
855
|
-
state[key] = value;
|
|
856
|
-
}
|
|
857
|
-
catch (err) {
|
|
858
|
-
Oops$1.ComputeFailed(subject, key).warn();
|
|
859
|
-
throw err;
|
|
860
|
-
}
|
|
861
|
-
};
|
|
862
|
-
if (argument)
|
|
863
|
-
init();
|
|
864
|
-
else
|
|
865
|
-
output.get = () => {
|
|
866
|
-
const get = output.get =
|
|
867
|
-
key in state ? undefined : init();
|
|
868
|
-
return get ? get() : state[key];
|
|
869
|
-
};
|
|
870
|
-
return output;
|
|
871
|
-
}
|
|
872
|
-
const set = typeof argument == "function"
|
|
873
|
-
? createValueEffect(argument)
|
|
874
|
-
: undefined;
|
|
875
|
-
if (value !== undefined) {
|
|
876
|
-
state[key] = value;
|
|
877
|
-
return { set };
|
|
878
|
-
}
|
|
879
|
-
const output = {
|
|
880
|
-
get() {
|
|
881
|
-
if (key in state)
|
|
882
|
-
return state[key];
|
|
883
|
-
throw suspense(control, key);
|
|
884
|
-
}
|
|
885
|
-
};
|
|
886
|
-
if (set)
|
|
887
|
-
output.set = function (value) {
|
|
888
|
-
output.set = set;
|
|
889
|
-
state[key] = state[key];
|
|
890
|
-
return set.call(this, value);
|
|
891
|
-
};
|
|
892
|
-
return output;
|
|
893
|
-
});
|
|
894
|
-
}
|
|
895
|
-
|
|
896
|
-
function use(input, argument) {
|
|
897
|
-
return apply((key, source) => {
|
|
898
|
-
const { state, subject } = source;
|
|
899
|
-
if (typeof input === "function")
|
|
900
|
-
input = new input();
|
|
901
|
-
function set(next) {
|
|
902
|
-
if (next instanceof Model) {
|
|
903
|
-
parent(next, subject);
|
|
904
|
-
control(next, true);
|
|
905
|
-
}
|
|
906
|
-
else if (next)
|
|
907
|
-
next = manage(next);
|
|
908
|
-
state[key] = next;
|
|
909
|
-
if (typeof argument == "function")
|
|
910
|
-
argument(next);
|
|
911
|
-
return true;
|
|
912
|
-
}
|
|
913
|
-
set(input);
|
|
914
|
-
return { set };
|
|
915
|
-
});
|
|
916
|
-
}
|
|
917
|
-
function manage(next) {
|
|
918
|
-
const subject = assign(create(next), {
|
|
919
|
-
get: getMethod,
|
|
920
|
-
set: setMethod
|
|
921
|
-
});
|
|
922
|
-
const control = new Control(subject, false);
|
|
923
|
-
for (const key in control.state = next)
|
|
924
|
-
control.watch(key, {});
|
|
925
|
-
return subject;
|
|
926
|
-
}
|
|
927
|
-
|
|
928
|
-
const Oops = issues({
|
|
929
|
-
MultipleExist: (name) => `Did find ${name} in context, but multiple were defined.`
|
|
930
|
-
});
|
|
931
|
-
class Context {
|
|
932
|
-
constructor() {
|
|
933
|
-
this.table = new WeakMap();
|
|
934
|
-
this.layer = new Map();
|
|
935
|
-
}
|
|
936
|
-
has(T) {
|
|
937
|
-
let key = this.table.get(T);
|
|
938
|
-
if (!key) {
|
|
939
|
-
key = Symbol(T.name);
|
|
940
|
-
this.table.set(T, key);
|
|
941
|
-
}
|
|
942
|
-
return key;
|
|
943
|
-
}
|
|
944
|
-
get(Type) {
|
|
945
|
-
const result = this[this.has(Type)];
|
|
946
|
-
if (result === null)
|
|
947
|
-
throw Oops.MultipleExist(Type);
|
|
948
|
-
return result;
|
|
949
|
-
}
|
|
950
|
-
include(inputs) {
|
|
951
|
-
const init = new Map();
|
|
952
|
-
for (const key in inputs) {
|
|
953
|
-
const input = inputs[key];
|
|
954
|
-
const exists = this.layer.get(key);
|
|
955
|
-
if (!exists) {
|
|
956
|
-
const instance = this.add(input);
|
|
957
|
-
this.layer.set(key, input);
|
|
958
|
-
init.set(instance, true);
|
|
959
|
-
}
|
|
960
|
-
// Context must force-reset becasue inputs are no longer safe.
|
|
961
|
-
else if (exists !== input) {
|
|
962
|
-
this.pop();
|
|
963
|
-
this.key = uid();
|
|
964
|
-
return this.include(inputs);
|
|
965
|
-
}
|
|
966
|
-
}
|
|
967
|
-
for (const [model] of init) {
|
|
968
|
-
const { state } = control(model, true);
|
|
969
|
-
Object.values(state).forEach(value => {
|
|
970
|
-
if (parent(value) === model) {
|
|
971
|
-
this.add(value, true);
|
|
972
|
-
init.set(value, false);
|
|
973
|
-
}
|
|
974
|
-
});
|
|
975
|
-
}
|
|
976
|
-
return init;
|
|
977
|
-
}
|
|
978
|
-
add(input, implicit) {
|
|
979
|
-
let writable = true;
|
|
980
|
-
let T;
|
|
981
|
-
let I;
|
|
982
|
-
if (typeof input == "function") {
|
|
983
|
-
T = input;
|
|
984
|
-
I = new input();
|
|
985
|
-
}
|
|
986
|
-
else {
|
|
987
|
-
I = control(input).subject;
|
|
988
|
-
T = I.constructor;
|
|
989
|
-
writable = false;
|
|
990
|
-
}
|
|
991
|
-
do {
|
|
992
|
-
const key = this.has(T);
|
|
993
|
-
const value = this.hasOwnProperty(key) ? null : I;
|
|
994
|
-
if (value || I !== this[key] && !implicit)
|
|
995
|
-
defineProperty(this, key, {
|
|
996
|
-
configurable: true,
|
|
997
|
-
value,
|
|
998
|
-
writable
|
|
999
|
-
});
|
|
1000
|
-
T = getPrototypeOf(T);
|
|
1001
|
-
} while (T !== Model);
|
|
1002
|
-
return I;
|
|
1003
|
-
}
|
|
1004
|
-
push() {
|
|
1005
|
-
const next = create(this);
|
|
1006
|
-
next.layer = new Map();
|
|
1007
|
-
return next;
|
|
1008
|
-
}
|
|
1009
|
-
pop() {
|
|
1010
|
-
const items = new Set();
|
|
1011
|
-
for (const key of getOwnPropertySymbols(this)) {
|
|
1012
|
-
const entry = getOwnPropertyDescriptor(this, key);
|
|
1013
|
-
if (entry.writable && entry.value)
|
|
1014
|
-
items.add(entry.value);
|
|
1015
|
-
delete this[key];
|
|
1016
|
-
}
|
|
1017
|
-
for (const model of items)
|
|
1018
|
-
model.null();
|
|
1019
|
-
this.layer.clear();
|
|
1020
|
-
}
|
|
1021
|
-
}
|
|
1022
|
-
|
|
1023
|
-
const STATE = "__state";
|
|
1024
|
-
const UPDATE = "__update";
|
|
1025
|
-
const CONTROL = "__control";
|
|
1026
|
-
const PARENT = "__parent";
|
|
1027
|
-
defineProperties(Model.prototype, {
|
|
1028
|
-
[CONTROL]: {
|
|
1029
|
-
get() {
|
|
1030
|
-
return control(this);
|
|
1031
|
-
}
|
|
1032
|
-
},
|
|
1033
|
-
[STATE]: {
|
|
1034
|
-
get() {
|
|
1035
|
-
return Object.assign({}, control(this).state);
|
|
1036
|
-
}
|
|
1037
|
-
},
|
|
1038
|
-
[UPDATE]: {
|
|
1039
|
-
get() {
|
|
1040
|
-
return control(this).latest;
|
|
1041
|
-
}
|
|
1042
|
-
},
|
|
1043
|
-
[PARENT]: {
|
|
1044
|
-
get() {
|
|
1045
|
-
return parent(this);
|
|
1046
|
-
}
|
|
1047
|
-
}
|
|
1048
|
-
});
|
|
1049
|
-
const Debug = {
|
|
1050
|
-
CONTROL,
|
|
1051
|
-
STATE,
|
|
1052
|
-
UPDATE,
|
|
1053
|
-
PARENT
|
|
1054
|
-
};
|
|
1055
|
-
|
|
1056
|
-
exports.Context = Context;
|
|
1057
|
-
exports.Control = Control;
|
|
1058
|
-
exports.Debug = Debug;
|
|
1059
|
-
exports.Model = Model;
|
|
1060
|
-
exports["default"] = Model;
|
|
1061
|
-
exports.get = get;
|
|
1062
|
-
exports.ref = ref;
|
|
1063
|
-
exports.run = run;
|
|
1064
|
-
exports.set = set;
|
|
1065
|
-
exports.use = use;
|