grainjs 1.0.2 → 1.1.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/README.md +23 -71
- package/dist/cjs/index.js +5 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/lib/PriorityQueue.d.ts +1 -1
- package/dist/cjs/lib/_computed_queue.js +3 -3
- package/dist/cjs/lib/_computed_queue.js.map +1 -1
- package/dist/cjs/lib/binding.d.ts +11 -4
- package/dist/cjs/lib/binding.js +5 -5
- package/dist/cjs/lib/binding.js.map +1 -1
- package/dist/cjs/lib/computed.d.ts +49 -28
- package/dist/cjs/lib/computed.js +38 -52
- package/dist/cjs/lib/computed.js.map +1 -1
- package/dist/cjs/lib/dispose.d.ts +109 -96
- package/dist/cjs/lib/dispose.js +106 -80
- package/dist/cjs/lib/dispose.js.map +1 -1
- package/dist/cjs/lib/dom.d.ts +38 -18
- package/dist/cjs/lib/dom.js +44 -20
- package/dist/cjs/lib/dom.js.map +1 -1
- package/dist/cjs/lib/domComponent.d.ts +56 -48
- package/dist/cjs/lib/domComponent.js +66 -1
- package/dist/cjs/lib/domComponent.js.map +1 -1
- package/dist/cjs/lib/domComputed.d.ts +31 -21
- package/dist/cjs/lib/domComputed.js +14 -11
- package/dist/cjs/lib/domComputed.js.map +1 -1
- package/dist/cjs/lib/domDispose.d.ts +27 -12
- package/dist/cjs/lib/domDispose.js +26 -11
- package/dist/cjs/lib/domDispose.js.map +1 -1
- package/dist/cjs/lib/domForEach.d.ts +4 -3
- package/dist/cjs/lib/domForEach.js +10 -9
- package/dist/cjs/lib/domForEach.js.map +1 -1
- package/dist/cjs/lib/domImpl.d.ts +33 -10
- package/dist/cjs/lib/domImpl.js +28 -9
- package/dist/cjs/lib/domImpl.js.map +1 -1
- package/dist/cjs/lib/domMethods.d.ts +93 -47
- package/dist/cjs/lib/domMethods.js +88 -46
- package/dist/cjs/lib/domMethods.js.map +1 -1
- package/dist/cjs/lib/domevent.d.ts +87 -62
- package/dist/cjs/lib/domevent.js +84 -59
- package/dist/cjs/lib/domevent.js.map +1 -1
- package/dist/cjs/lib/emit.d.ts +62 -32
- package/dist/cjs/lib/emit.js +67 -53
- package/dist/cjs/lib/emit.js.map +1 -1
- package/dist/cjs/lib/kowrap.d.ts +6 -3
- package/dist/cjs/lib/kowrap.js +6 -3
- package/dist/cjs/lib/kowrap.js.map +1 -1
- package/dist/cjs/lib/obsArray.d.ts +91 -53
- package/dist/cjs/lib/obsArray.js +87 -55
- package/dist/cjs/lib/obsArray.js.map +1 -1
- package/dist/cjs/lib/observable.d.ts +25 -15
- package/dist/cjs/lib/observable.js +29 -18
- package/dist/cjs/lib/observable.js.map +1 -1
- package/dist/cjs/lib/pureComputed.d.ts +12 -15
- package/dist/cjs/lib/pureComputed.js +15 -18
- package/dist/cjs/lib/pureComputed.js.map +1 -1
- package/dist/cjs/lib/styled.d.ts +78 -61
- package/dist/cjs/lib/styled.js +26 -79
- package/dist/cjs/lib/styled.js.map +1 -1
- package/dist/cjs/lib/subscribe.d.ts +41 -37
- package/dist/cjs/lib/subscribe.js +31 -40
- package/dist/cjs/lib/subscribe.js.map +1 -1
- package/dist/cjs/lib/util.js +1 -0
- package/dist/cjs/lib/util.js.map +1 -1
- package/dist/cjs/lib/widgets/input.d.ts +3 -1
- package/dist/cjs/lib/widgets/input.js +6 -4
- package/dist/cjs/lib/widgets/input.js.map +1 -1
- package/dist/cjs/lib/widgets/select.d.ts +4 -2
- package/dist/cjs/lib/widgets/select.js +7 -5
- package/dist/cjs/lib/widgets/select.js.map +1 -1
- package/dist/esm/lib/_computed_queue.js +3 -3
- package/dist/esm/lib/_computed_queue.js.map +1 -1
- package/dist/esm/lib/binding.js +2 -2
- package/dist/esm/lib/binding.js.map +1 -1
- package/dist/esm/lib/computed.js +36 -50
- package/dist/esm/lib/computed.js.map +1 -1
- package/dist/esm/lib/dispose.js +104 -78
- package/dist/esm/lib/dispose.js.map +1 -1
- package/dist/esm/lib/dom.js +38 -18
- package/dist/esm/lib/dom.js.map +1 -1
- package/dist/esm/lib/domComponent.js +65 -0
- package/dist/esm/lib/domComponent.js.map +1 -1
- package/dist/esm/lib/domComputed.js +10 -7
- package/dist/esm/lib/domComputed.js.map +1 -1
- package/dist/esm/lib/domDispose.js +26 -11
- package/dist/esm/lib/domDispose.js.map +1 -1
- package/dist/esm/lib/domForEach.js +3 -2
- package/dist/esm/lib/domForEach.js.map +1 -1
- package/dist/esm/lib/domImpl.js +26 -7
- package/dist/esm/lib/domImpl.js.map +1 -1
- package/dist/esm/lib/domMethods.js +77 -35
- package/dist/esm/lib/domMethods.js.map +1 -1
- package/dist/esm/lib/domevent.js +84 -59
- package/dist/esm/lib/domevent.js.map +1 -1
- package/dist/esm/lib/emit.js +67 -53
- package/dist/esm/lib/emit.js.map +1 -1
- package/dist/esm/lib/kowrap.js +5 -2
- package/dist/esm/lib/kowrap.js.map +1 -1
- package/dist/esm/lib/obsArray.js +82 -50
- package/dist/esm/lib/obsArray.js.map +1 -1
- package/dist/esm/lib/observable.js +26 -15
- package/dist/esm/lib/observable.js.map +1 -1
- package/dist/esm/lib/pureComputed.js +15 -18
- package/dist/esm/lib/pureComputed.js.map +1 -1
- package/dist/esm/lib/styled.js +24 -77
- package/dist/esm/lib/styled.js.map +1 -1
- package/dist/esm/lib/subscribe.js +27 -36
- package/dist/esm/lib/subscribe.js.map +1 -1
- package/dist/esm/lib/util.js +1 -0
- package/dist/esm/lib/util.js.map +1 -1
- package/dist/esm/lib/widgets/input.js +3 -1
- package/dist/esm/lib/widgets/input.js.map +1 -1
- package/dist/esm/lib/widgets/select.js +3 -1
- package/dist/esm/lib/widgets/select.js.map +1 -1
- package/dist/grain-full.debug.js +2146 -3062
- package/dist/grain-full.debug.js.map +7 -0
- package/dist/grain-full.min.js +6 -2
- package/dist/grain-full.min.js.map +7 -1
- package/lib/binding.ts +9 -2
- package/lib/computed.ts +56 -56
- package/lib/dispose.ts +110 -85
- package/lib/dom.ts +39 -20
- package/lib/domComponent.ts +66 -57
- package/lib/domComputed.ts +29 -19
- package/lib/domDispose.ts +28 -11
- package/lib/domForEach.ts +7 -3
- package/lib/domImpl.ts +30 -7
- package/lib/domMethods.ts +101 -46
- package/lib/domevent.ts +85 -60
- package/lib/emit.ts +64 -50
- package/lib/kowrap.ts +5 -2
- package/lib/obsArray.ts +89 -54
- package/lib/observable.ts +26 -15
- package/lib/pureComputed.ts +16 -22
- package/lib/styled.ts +85 -71
- package/lib/subscribe.ts +41 -45
- package/lib/util.ts +1 -0
- package/lib/widgets/input.ts +3 -1
- package/lib/widgets/select.ts +3 -1
- package/package.json +38 -27
package/README.md
CHANGED
|
@@ -1,86 +1,38 @@
|
|
|
1
|
-
# GrainJS
|
|
1
|
+
# GrainJS: a light typescript web framework
|
|
2
2
|
|
|
3
3
|
[](https://badge.fury.io/js/grainjs)
|
|
4
|
-
[](https://github.com/gristlabs/grainjs/actions/workflows/build-and-test.yml)
|
|
5
|
+
[](https://codecov.io/gh/gristlabs/grainjs)
|
|
5
6
|
|
|
6
|
-
GrainJS is a
|
|
7
|
-
applications.
|
|
7
|
+
GrainJS is a JavaScript / TypeScript library for building dynamic web applications.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
[Knockout](http://knockoutjs.com/documentation/introduction.html)
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
- It's in part inspired by [React](https://reactjs.org/), but based on observables (like
|
|
10
|
+
[Knockout](http://knockoutjs.com/documentation/introduction.html)) instead of virtual dom.
|
|
11
|
+
- It is lightweight, has no dependencies, and takes only ~30KB minified.
|
|
12
|
+
- It needs no special tooling. It's nothing more than a library.
|
|
13
|
+
- It supports convenient DOM-building in JS, event dispatching, DOM event subscriptions,
|
|
14
|
+
disposable components, and in-code CSS styling.
|
|
15
|
+
- It's fully typed for use with TypeScript.
|
|
16
|
+
- It's proven its worth by powering [Grist](https://github.com/gristlabs/grist-core#grist)'s rich
|
|
17
|
+
frontend app.
|
|
13
18
|
|
|
14
|
-
|
|
15
|
-
virtual dom, and with a convenient way to build DOM without JSX. It is lighter weight, and has
|
|
16
|
-
less magic happening under the covers.
|
|
19
|
+
## Documentation
|
|
17
20
|
|
|
18
|
-
|
|
19
|
-
minified.
|
|
21
|
+
For docs, visit [https://gristlabs.github.io/grainjs/](https://gristlabs.github.io/grainjs/).
|
|
20
22
|
|
|
21
23
|
## Installation
|
|
22
24
|
|
|
25
|
+
```sh
|
|
26
|
+
npm install grainjs
|
|
23
27
|
```
|
|
24
|
-
npm install --save grainjs
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
## Basic Example
|
|
28
|
-
|
|
29
|
-
```typescript
|
|
30
|
-
const name = observable("");
|
|
31
|
-
|
|
32
|
-
dom.update(document.body,
|
|
33
|
-
dom('input', {type: 'text', placeholder: 'Enter your name'},
|
|
34
|
-
dom.on('input', (ev, elem) => name.set(elem.value)),
|
|
35
|
-
),
|
|
36
|
-
dom('div', 'Hello, ',
|
|
37
|
-
dom.text((use) => use(name).toUpperCase() || 'Stranger'),
|
|
38
|
-
'!',
|
|
39
|
-
),
|
|
40
|
-
);
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
# Documentation
|
|
44
|
-
|
|
45
|
-
At a basic level, GrainJS allows you to describe DOM structure in one place, using Javascript (or
|
|
46
|
-
TypeScript), and to keep the dynamic aspects of it separated into variables called "observables".
|
|
47
|
-
These observables serve as the model of the UI; other code can update them to cause UI to update,
|
|
48
|
-
without knowing the details of the DOM construction.
|
|
49
|
-
|
|
50
|
-
In addition, the library provides approaches to create and dispose resources (important for
|
|
51
|
-
long-lived single-page applications), and an assortment of other related tools.
|
|
52
28
|
|
|
53
|
-
|
|
54
|
-
- [DOM Construction](docs/basics.md#dom-construction)
|
|
55
|
-
- [Observables](docs/basics.md#observables)
|
|
56
|
-
- [Computed Observables](docs/basics.md#computed-observables)
|
|
57
|
-
- [DOM Bindings](docs/basics.md#dom-bindings)
|
|
58
|
-
- [Conditional DOM](docs/basics.md#conditional-dom)
|
|
59
|
-
- [Repeating DOM](docs/basics.md#repeating-dom)
|
|
60
|
-
- [DOM Events](docs/basics.md#dom-events)
|
|
61
|
-
- [Styling DOM](docs/basics.md#styling-dom)
|
|
29
|
+
Or see [Getting started with GrainJS](https://gristlabs.github.io/grainjs/getting-started.html).
|
|
62
30
|
|
|
63
|
-
|
|
64
|
-
- [Class Disposable](docs/dispose.md#class-disposable)
|
|
65
|
-
- [Taking Ownership](docs/dispose.md#taking-ownership)
|
|
66
|
-
- [Holders](docs/dispose.md#holders)
|
|
67
|
-
- [Further Notes](docs/dispose.md#further-notes)
|
|
31
|
+
## Examples
|
|
68
32
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
- [Disposable Values](docs/more-observables.md#disposable-values)
|
|
72
|
-
- [ObsArray](docs/more-observables.md#obsarray)
|
|
73
|
-
- [PureComputed](docs/more-observables.md#purecomputed)
|
|
74
|
-
- [Order of Evaluation](docs/more-observables.md#order-of-evaluation)
|
|
33
|
+
See basic examples in [Quick tour](https://gristlabs.github.io/grainjs/#quick-tour) or complete examples
|
|
34
|
+
at [Examples](https://gristlabs.github.io/grainjs/examples.html).
|
|
75
35
|
|
|
76
|
-
|
|
77
|
-
- [Event Emitters](docs/misc.md#event-emitters)
|
|
78
|
-
- [Disposing DOM](docs/misc.md#disposing-dom)
|
|
79
|
-
- [DOM Components](docs/misc.md#dom-components)
|
|
80
|
-
- [Functional Components](docs/misc.md#functional-components)
|
|
81
|
-
- [Knockout Integration](docs/misc.md#knockout-integration)
|
|
36
|
+
## License
|
|
82
37
|
|
|
83
|
-
-
|
|
84
|
-
- [DOM Reference](docs/reference.md#dom-reference)
|
|
85
|
-
- [Disposables Reference](docs/reference.md#disposables-reference)
|
|
86
|
-
- [Observables Reference](docs/reference.md#observables-reference)
|
|
38
|
+
GrainJS is licensed under [Apache-2.0 license](https://github.com/gristlabs/grainjs/blob/main/LICENSE).
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,iDAA+B;AAC/B,gDAA8B;AAC9B,4CAA0B;AAC1B,6CAA2B;AAC3B,+CAA6B;AAC7B,iDAA+B;AAC/B,mDAAiC;AACjC,qDAAmC;AACnC,+CAA6B;AAC7B,kDAAgC;AAChC,6CAA2B;AAC3B,sDAAoC;AACpC,uDAAqC"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* It is constructed with a function that returns which of two items is "prior"; the pop() method
|
|
7
7
|
* returns the most-prior element.
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
9
|
+
export type IsPriorFunc<T> = (a: T, b: T) => boolean;
|
|
10
10
|
export declare class PriorityQueue<T> {
|
|
11
11
|
private _isPrior;
|
|
12
12
|
private _items;
|
|
@@ -24,6 +24,9 @@ const PriorityQueue_1 = require("./PriorityQueue");
|
|
|
24
24
|
* for subscriptions and computed observables.
|
|
25
25
|
*/
|
|
26
26
|
class DepItem {
|
|
27
|
+
static isPrioritySmaller(a, b) {
|
|
28
|
+
return a._priority < b._priority || (a._priority === b._priority && a._creation < b._creation);
|
|
29
|
+
}
|
|
27
30
|
/**
|
|
28
31
|
* Callback should call depItem.useDep(dep) for each DepInput it depends on.
|
|
29
32
|
*/
|
|
@@ -35,9 +38,6 @@ class DepItem {
|
|
|
35
38
|
this._callback = callback;
|
|
36
39
|
this._context = optContext;
|
|
37
40
|
}
|
|
38
|
-
static isPrioritySmaller(a, b) {
|
|
39
|
-
return a._priority < b._priority || (a._priority === b._priority && a._creation < b._creation);
|
|
40
|
-
}
|
|
41
41
|
/**
|
|
42
42
|
* Mark depItem as a dependency of this DepItem. The argument may be null to indicate a leaf (an
|
|
43
43
|
* item such as a plain observable, which does not itself depend on anything else).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_computed_queue.js","sourceRoot":"","sources":["../../../lib/_computed_queue.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;AAEH,mDAA8C;AAE9C;;;GAGG;AACH,MAAa,OAAO;
|
|
1
|
+
{"version":3,"file":"_computed_queue.js","sourceRoot":"","sources":["../../../lib/_computed_queue.ts"],"names":[],"mappings":"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"}
|
|
@@ -6,8 +6,15 @@ import { IDisposable } from './dispose';
|
|
|
6
6
|
import { IKnockoutReadObservable, InferKoType } from './kowrap';
|
|
7
7
|
import { BaseObservable } from './observable';
|
|
8
8
|
import { UseCBOwner } from './subscribe';
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Any of the value types that DOM methods know how to subscribe to: a plain value (like a
|
|
11
|
+
* string); an Observable (including a Computed); a knockout observable; a function.
|
|
12
|
+
*
|
|
13
|
+
* If a function, it's used to create a `Computed`, and will be called with a context function
|
|
14
|
+
* `use`, allowing it to depend on other observable values (see documentation for `Computed`).
|
|
15
|
+
*/
|
|
16
|
+
export type BindableValue<T> = BaseObservable<T> | ComputedCallback<T> | T | IKnockoutReadObservable<T>;
|
|
17
|
+
export type ComputedCallback<T> = (use: UseCBOwner, ...args: any[]) => T;
|
|
11
18
|
/**
|
|
12
19
|
* Subscribes a callback to valueObs, which may be one a plain value, an observable, a knockout
|
|
13
20
|
* observable, or a function. If a function, it's used to create a computed() and will be called
|
|
@@ -22,7 +29,7 @@ export declare type ComputedCallback<T> = (use: UseCBOwner, ...args: any[]) => T
|
|
|
22
29
|
export declare function subscribeBindable<KObs extends IKnockoutReadObservable<any>>(valueObs: KObs, callback: (val: InferKoType<KObs>) => void): IDisposable | null;
|
|
23
30
|
export declare function subscribeBindable<T>(valueObs: BindableValue<T>, callback: (val: T) => void): IDisposable | null;
|
|
24
31
|
/**
|
|
25
|
-
* Subscribes a callback to valueObs (which may be a value, observable, or function) using
|
|
26
|
-
*
|
|
32
|
+
* Subscribes a callback to `valueObs` (which may be a value, observable, or function) using
|
|
33
|
+
* `subscribeBindable()`, and ties the disposal of this subscription to the passed-in element.
|
|
27
34
|
*/
|
|
28
35
|
export declare function subscribeElem<T>(elem: Node, valueObs: BindableValue<T>, callback: (newVal: T, oldVal?: T) => void): void;
|
package/dist/cjs/lib/binding.js
CHANGED
|
@@ -23,7 +23,7 @@ function subscribeBindable(valueObs, callback) {
|
|
|
23
23
|
// let sub = subscribe(use => callback(valueObs(use)));
|
|
24
24
|
// The difference is that when valueObs() evaluates to unchanged value, callback would be
|
|
25
25
|
// called in the version above, but not in the version below.
|
|
26
|
-
const comp = computed_1.computed(valueObs);
|
|
26
|
+
const comp = (0, computed_1.computed)(valueObs);
|
|
27
27
|
comp.addListener((val) => callback(val));
|
|
28
28
|
callback(comp.get());
|
|
29
29
|
return comp; // Disposing this will dispose its one listener.
|
|
@@ -32,18 +32,18 @@ function subscribeBindable(valueObs, callback) {
|
|
|
32
32
|
if (valueObs instanceof observable_1.BaseObservable) {
|
|
33
33
|
// Use subscribe() rather than addListener(), so that bundling of changes (implicit and with
|
|
34
34
|
// bundleChanges()) is respected. This matters when callback also uses observables.
|
|
35
|
-
return subscribe_1.subscribe(valueObs, (use, val) => callback(val));
|
|
35
|
+
return (0, subscribe_1.subscribe)(valueObs, (use, val) => callback(val));
|
|
36
36
|
}
|
|
37
37
|
callback(valueObs);
|
|
38
38
|
return null;
|
|
39
39
|
}
|
|
40
40
|
exports.subscribeBindable = subscribeBindable;
|
|
41
41
|
/**
|
|
42
|
-
* Subscribes a callback to valueObs (which may be a value, observable, or function) using
|
|
43
|
-
*
|
|
42
|
+
* Subscribes a callback to `valueObs` (which may be a value, observable, or function) using
|
|
43
|
+
* `subscribeBindable()`, and ties the disposal of this subscription to the passed-in element.
|
|
44
44
|
*/
|
|
45
45
|
function subscribeElem(elem, valueObs, callback) {
|
|
46
|
-
domDispose_1.autoDisposeElem(elem, subscribeBindable(valueObs, callback));
|
|
46
|
+
(0, domDispose_1.autoDisposeElem)(elem, subscribeBindable(valueObs, callback));
|
|
47
47
|
}
|
|
48
48
|
exports.subscribeElem = subscribeElem;
|
|
49
49
|
//# sourceMappingURL=binding.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"binding.js","sourceRoot":"","sources":["../../../lib/binding.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,yCAAoC;AAEpC,6CAA6C;AAE7C,6CAA4C;AAC5C,2CAAkD;
|
|
1
|
+
{"version":3,"file":"binding.js","sourceRoot":"","sources":["../../../lib/binding.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,yCAAoC;AAEpC,6CAA6C;AAE7C,6CAA4C;AAC5C,2CAAkD;AA6BlD,SAAgB,iBAAiB,CAC7B,QAA0B,EAAE,QAA0B;IACxD,wEAAwE;IACxE,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE;QAClC,uBAAuB;QACvB,MAAM,OAAO,GAAG,QAAsC,CAAC;QACvD,IAAI,OAAO,OAAO,CAAC,IAAI,KAAK,UAAU,EAAE;YACtC,MAAM,GAAG,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;YACtD,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;YACzB,OAAO,GAAG,CAAC;SACZ;QAED,6EAA6E;QAC7E,0DAA0D;QAC1D,yFAAyF;QACzF,6DAA6D;QAC7D,MAAM,IAAI,GAAG,IAAA,mBAAQ,EAAC,QAA+B,CAAC,CAAC;QACvD,IAAI,CAAC,WAAW,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;QACzC,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;QACrB,OAAO,IAAI,CAAC,CAAM,gDAAgD;KACnE;IAED,iBAAiB;IACjB,IAAI,QAAQ,YAAY,2BAAc,EAAE;QACtC,4FAA4F;QAC5F,mFAAmF;QACnF,OAAO,IAAA,qBAAS,EAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;KACzD;IAED,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACnB,OAAO,IAAI,CAAC;AACd,CAAC;AA/BD,8CA+BC;AAED;;;GAGG;AACH,SAAgB,aAAa,CAAI,IAAU,EAAE,QAA0B,EACtC,QAAyC;IACxE,IAAA,4BAAe,EAAC,IAAI,EAAE,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;AAC/D,CAAC;AAHD,sCAGC"}
|
|
@@ -1,44 +1,62 @@
|
|
|
1
|
+
import { DepItem } from './_computed_queue';
|
|
2
|
+
import { IDisposableOwnerT } from './dispose';
|
|
3
|
+
import { BaseObservable as Obs, Observable } from './observable';
|
|
4
|
+
import { ISubscribable, UseCBOwner as UseCB } from './subscribe';
|
|
5
|
+
/** @internal */
|
|
6
|
+
type Owner<T> = IDisposableOwnerT<Computed<T>> | null;
|
|
1
7
|
/**
|
|
2
|
-
*
|
|
8
|
+
* `Computed` implements a computed observable, whose value depends on other observables and gets
|
|
3
9
|
* recalculated automatically when they change.
|
|
4
10
|
*
|
|
5
|
-
* E.g. if we have some existing observables (which may themselves be instances of `
|
|
11
|
+
* E.g. if we have some existing observables (which may themselves be instances of `Computed`),
|
|
6
12
|
* we can create a computed that subscribes to them explicitly:
|
|
7
|
-
*
|
|
8
|
-
*
|
|
13
|
+
* ```ts
|
|
14
|
+
* const obs1 = Observable.create(null, 5), obs2 = Observable.create(null, 12);
|
|
15
|
+
* const computed1 = Computed.create(null, obs1, obs2, (use, v1, v2) => v1 + v2);
|
|
16
|
+
* ```
|
|
9
17
|
*
|
|
10
18
|
* or implicitly by using `use(obs)` function:
|
|
11
|
-
*
|
|
19
|
+
* ```ts
|
|
20
|
+
* const computed2 = Computed.create(null, use => use(obs1) + use(obs2));
|
|
21
|
+
* ```
|
|
12
22
|
*
|
|
13
|
-
* In either case, computed1.get() and computed2.get() will have the value 17. If obs1 or
|
|
14
|
-
* changed, computed1 and computed2 will get recomputed automatically.
|
|
23
|
+
* In either case, `computed1.get()` and `computed2.get()` will have the value 17. If `obs1` or
|
|
24
|
+
* `obs2` is changed, `computed1` and `computed2` will get recomputed automatically.
|
|
15
25
|
*
|
|
16
26
|
* Creating a computed allows any number of dependencies to be specified explicitly, and their
|
|
17
|
-
* values will be passed to the read() callback. These may be combined with automatic dependencies
|
|
18
|
-
* detected using use()
|
|
19
|
-
*
|
|
20
|
-
*
|
|
27
|
+
* values will be passed to the `read()` callback. These may be combined with automatic dependencies
|
|
28
|
+
* detected using `use()`. Note that constructor dependencies have less overhead.
|
|
29
|
+
* ```ts
|
|
30
|
+
* const val = Computed.create(null, ...deps, ((use, ...depValues) => READ_CALLBACK));
|
|
31
|
+
* ```
|
|
21
32
|
*
|
|
22
33
|
* You may specify a `write` callback by calling `onWrite(WRITE_CALLBACK)`, which will be called
|
|
23
|
-
* whenever set() is called on the computed by its user. If a `write` bacllback is not specified,
|
|
34
|
+
* whenever `set()` is called on the computed by its user. If a `write` bacllback is not specified,
|
|
24
35
|
* calling `set` on a computed observable will throw an exception.
|
|
25
36
|
*
|
|
26
|
-
* Note that
|
|
37
|
+
* Note that `PureComputed` offers a variation of `Computed` with the same interface, but which
|
|
27
38
|
* stays unsubscribed from dependencies while it itself has no subscribers.
|
|
28
39
|
*
|
|
29
40
|
* A computed may be used with a disposable value using `use.owner` as the value's owner. E.g.
|
|
30
|
-
*
|
|
41
|
+
* ```ts
|
|
42
|
+
* const val = Computed.create(null, ((use) => Foo.create(use.owner, use(a), use(b)));
|
|
43
|
+
* ```
|
|
31
44
|
*
|
|
32
|
-
* When the
|
|
33
|
-
* owned value. Note that only the pattern above works, i.e. use.owner may only be used to take
|
|
45
|
+
* When the `Computed` is re-evaluated, and when it itself is disposed, it disposes the previously
|
|
46
|
+
* owned value. Note that only the pattern above works, i.e. `use.owner` may only be used to take
|
|
34
47
|
* ownership of the same disposable that the callback returns.
|
|
35
48
|
*/
|
|
36
|
-
import { DepItem } from './_computed_queue';
|
|
37
|
-
import { IDisposableOwnerT } from './dispose';
|
|
38
|
-
import { BaseObservable as Obs, Observable } from './observable';
|
|
39
|
-
import { ISubscribable, UseCBOwner as UseCB } from './subscribe';
|
|
40
|
-
declare type Owner<T> = IDisposableOwnerT<Computed<T>> | null;
|
|
41
49
|
export declare class Computed<T> extends Observable<T> {
|
|
50
|
+
/**
|
|
51
|
+
* Creates a new Computed, owned by the given owner.
|
|
52
|
+
* @param owner - Object to own this Computed, or null to handle disposal manually.
|
|
53
|
+
* @param observables - Zero or more observables on which this computes depends. The callback
|
|
54
|
+
* will get called when any of these changes.
|
|
55
|
+
* @param callback - Read callback that will be called with `(use, ...values)`,
|
|
56
|
+
* i.e. the `use` function and values for all of the `...observables`. The callback is called
|
|
57
|
+
* immediately and whenever any dependency changes.
|
|
58
|
+
* @returns The newly created `Computed` observable.
|
|
59
|
+
*/
|
|
42
60
|
static create<T>(owner: Owner<T>, cb: (use: UseCB) => T): Computed<T>;
|
|
43
61
|
static create<T, A>(owner: Owner<T>, a: Obs<A>, cb: (use: UseCB, a: A) => T): Computed<T>;
|
|
44
62
|
static create<T, A, B>(owner: Owner<T>, a: Obs<A>, b: Obs<B>, cb: (use: UseCB, a: A, b: B) => T): Computed<T>;
|
|
@@ -48,18 +66,16 @@ export declare class Computed<T> extends Observable<T> {
|
|
|
48
66
|
private _callback;
|
|
49
67
|
private _write;
|
|
50
68
|
private _sub;
|
|
51
|
-
/**
|
|
52
|
-
* Internal constructor for a Computed observable. You should use computed() function instead.
|
|
53
|
-
*/
|
|
54
69
|
constructor(callback: (use: UseCB, ...args: any[]) => T, dependencies: ISubscribable[]);
|
|
55
70
|
/**
|
|
56
71
|
* Used by subscriptions to keep track of dependencies.
|
|
72
|
+
* @internal
|
|
57
73
|
*/
|
|
58
74
|
_getDepItem(): DepItem;
|
|
59
75
|
/**
|
|
60
76
|
* "Sets" the value of the computed by calling the write() callback if one was provided in the
|
|
61
77
|
* constructor. Throws an error if there was no such callback (not a "writable" computed).
|
|
62
|
-
* @param
|
|
78
|
+
* @param value - The value to pass to the write() callback.
|
|
63
79
|
*/
|
|
64
80
|
set(value: T): void;
|
|
65
81
|
/**
|
|
@@ -74,9 +90,14 @@ export declare class Computed<T> extends Observable<T> {
|
|
|
74
90
|
private _read;
|
|
75
91
|
}
|
|
76
92
|
/**
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
93
|
+
* Creates a new Computed.
|
|
94
|
+
* @param observables - The initial params, of which there may be zero or more, are
|
|
95
|
+
* observables on which this computed depends. When any of them change, the `read()` callback
|
|
96
|
+
* will be called with the values of these observables as arguments.
|
|
97
|
+
* @param readCallback - Read callback that will be called with `(use, ...values)`,
|
|
98
|
+
* i.e. the `use` function and values for all of the `...observables`. The callback is called
|
|
99
|
+
* immediately and whenever any dependency changes.
|
|
100
|
+
* @returns The newly created `Computed` observable.
|
|
80
101
|
*/
|
|
81
102
|
export declare function computed<T>(cb: (use: UseCB) => T): Computed<T>;
|
|
82
103
|
export declare function computed<T, A>(a: Obs<A>, cb: (use: UseCB, a: A) => T): Computed<T>;
|
package/dist/cjs/lib/computed.js
CHANGED
|
@@ -1,51 +1,60 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.computed = exports.Computed = void 0;
|
|
4
|
+
const dispose_1 = require("./dispose");
|
|
5
|
+
const observable_1 = require("./observable");
|
|
6
|
+
const subscribe_1 = require("./subscribe");
|
|
7
|
+
function _noWrite() {
|
|
8
|
+
throw new Error("Can't write to non-writable computed");
|
|
9
|
+
}
|
|
2
10
|
/**
|
|
3
|
-
*
|
|
11
|
+
* `Computed` implements a computed observable, whose value depends on other observables and gets
|
|
4
12
|
* recalculated automatically when they change.
|
|
5
13
|
*
|
|
6
|
-
* E.g. if we have some existing observables (which may themselves be instances of `
|
|
14
|
+
* E.g. if we have some existing observables (which may themselves be instances of `Computed`),
|
|
7
15
|
* we can create a computed that subscribes to them explicitly:
|
|
8
|
-
*
|
|
9
|
-
*
|
|
16
|
+
* ```ts
|
|
17
|
+
* const obs1 = Observable.create(null, 5), obs2 = Observable.create(null, 12);
|
|
18
|
+
* const computed1 = Computed.create(null, obs1, obs2, (use, v1, v2) => v1 + v2);
|
|
19
|
+
* ```
|
|
10
20
|
*
|
|
11
21
|
* or implicitly by using `use(obs)` function:
|
|
12
|
-
*
|
|
22
|
+
* ```ts
|
|
23
|
+
* const computed2 = Computed.create(null, use => use(obs1) + use(obs2));
|
|
24
|
+
* ```
|
|
13
25
|
*
|
|
14
|
-
* In either case, computed1.get() and computed2.get() will have the value 17. If obs1 or
|
|
15
|
-
* changed, computed1 and computed2 will get recomputed automatically.
|
|
26
|
+
* In either case, `computed1.get()` and `computed2.get()` will have the value 17. If `obs1` or
|
|
27
|
+
* `obs2` is changed, `computed1` and `computed2` will get recomputed automatically.
|
|
16
28
|
*
|
|
17
29
|
* Creating a computed allows any number of dependencies to be specified explicitly, and their
|
|
18
|
-
* values will be passed to the read() callback. These may be combined with automatic dependencies
|
|
19
|
-
* detected using use()
|
|
20
|
-
*
|
|
21
|
-
*
|
|
30
|
+
* values will be passed to the `read()` callback. These may be combined with automatic dependencies
|
|
31
|
+
* detected using `use()`. Note that constructor dependencies have less overhead.
|
|
32
|
+
* ```ts
|
|
33
|
+
* const val = Computed.create(null, ...deps, ((use, ...depValues) => READ_CALLBACK));
|
|
34
|
+
* ```
|
|
22
35
|
*
|
|
23
36
|
* You may specify a `write` callback by calling `onWrite(WRITE_CALLBACK)`, which will be called
|
|
24
|
-
* whenever set() is called on the computed by its user. If a `write` bacllback is not specified,
|
|
37
|
+
* whenever `set()` is called on the computed by its user. If a `write` bacllback is not specified,
|
|
25
38
|
* calling `set` on a computed observable will throw an exception.
|
|
26
39
|
*
|
|
27
|
-
* Note that
|
|
40
|
+
* Note that `PureComputed` offers a variation of `Computed` with the same interface, but which
|
|
28
41
|
* stays unsubscribed from dependencies while it itself has no subscribers.
|
|
29
42
|
*
|
|
30
43
|
* A computed may be used with a disposable value using `use.owner` as the value's owner. E.g.
|
|
31
|
-
*
|
|
44
|
+
* ```ts
|
|
45
|
+
* const val = Computed.create(null, ((use) => Foo.create(use.owner, use(a), use(b)));
|
|
46
|
+
* ```
|
|
32
47
|
*
|
|
33
|
-
* When the
|
|
34
|
-
* owned value. Note that only the pattern above works, i.e. use.owner may only be used to take
|
|
48
|
+
* When the `Computed` is re-evaluated, and when it itself is disposed, it disposes the previously
|
|
49
|
+
* owned value. Note that only the pattern above works, i.e. `use.owner` may only be used to take
|
|
35
50
|
* ownership of the same disposable that the callback returns.
|
|
36
51
|
*/
|
|
37
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
-
exports.computed = exports.Computed = void 0;
|
|
39
|
-
const dispose_1 = require("./dispose");
|
|
40
|
-
const observable_1 = require("./observable");
|
|
41
|
-
const subscribe_1 = require("./subscribe");
|
|
42
|
-
function _noWrite() {
|
|
43
|
-
throw new Error("Can't write to non-writable computed");
|
|
44
|
-
}
|
|
45
52
|
class Computed extends observable_1.Observable {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
53
|
+
static create(owner, ...args) {
|
|
54
|
+
const readCb = args.pop();
|
|
55
|
+
return (0, dispose_1.setDisposeOwner)(owner, new Computed(readCb, args));
|
|
56
|
+
}
|
|
57
|
+
// Internal constructor for a Computed observable. You should use computed() function instead.
|
|
49
58
|
constructor(callback, dependencies) {
|
|
50
59
|
// At initialization we force an undefined value even though it's not of type T: it gets set
|
|
51
60
|
// to a proper value during the creation of new Subscription, which calls this._read.
|
|
@@ -54,22 +63,9 @@ class Computed extends observable_1.Observable {
|
|
|
54
63
|
this._write = _noWrite;
|
|
55
64
|
this._sub = new subscribe_1.Subscription(this._read.bind(this), dependencies, this);
|
|
56
65
|
}
|
|
57
|
-
/**
|
|
58
|
-
* Creates a new Computed, owned by the given owner.
|
|
59
|
-
* @param owner: Object to own this Computed, or null to handle disposal manually.
|
|
60
|
-
* @param ...observables: Zero or more observables on which this computes depends. The callback
|
|
61
|
-
* will get called when any of these changes.
|
|
62
|
-
* @param callback: Read callback that will be called with (use, ...values),
|
|
63
|
-
* i.e. the `use` function and values for all of the ...observables. The callback is called
|
|
64
|
-
* immediately and whenever any dependency changes.
|
|
65
|
-
* @returns {Computed} The newly created computed observable.
|
|
66
|
-
*/
|
|
67
|
-
static create(owner, ...args) {
|
|
68
|
-
const readCb = args.pop();
|
|
69
|
-
return dispose_1.setDisposeOwner(owner, new Computed(readCb, args));
|
|
70
|
-
}
|
|
71
66
|
/**
|
|
72
67
|
* Used by subscriptions to keep track of dependencies.
|
|
68
|
+
* @internal
|
|
73
69
|
*/
|
|
74
70
|
_getDepItem() {
|
|
75
71
|
return this._sub._getDepItem();
|
|
@@ -77,7 +73,7 @@ class Computed extends observable_1.Observable {
|
|
|
77
73
|
/**
|
|
78
74
|
* "Sets" the value of the computed by calling the write() callback if one was provided in the
|
|
79
75
|
* constructor. Throws an error if there was no such callback (not a "writable" computed).
|
|
80
|
-
* @param
|
|
76
|
+
* @param value - The value to pass to the write() callback.
|
|
81
77
|
*/
|
|
82
78
|
set(value) { this._write(value); }
|
|
83
79
|
/**
|
|
@@ -100,16 +96,6 @@ class Computed extends observable_1.Observable {
|
|
|
100
96
|
}
|
|
101
97
|
}
|
|
102
98
|
exports.Computed = Computed;
|
|
103
|
-
/**
|
|
104
|
-
* Creates a new Computed.
|
|
105
|
-
* @param {Observable} ...observables: The initial params, of which there may be zero or more, are
|
|
106
|
-
* observables on which this computed depends. When any of them change, the read() callback
|
|
107
|
-
* will be called with the values of these observables as arguments.
|
|
108
|
-
* @param {Function} readCallback: Read callback that will be called with (use, ...values),
|
|
109
|
-
* i.e. the `use` function and values for all of the ...observables. The callback is called
|
|
110
|
-
* immediately and whenever any dependency changes.
|
|
111
|
-
* @returns {Computed} The newly created computed observable.
|
|
112
|
-
*/
|
|
113
99
|
function computed(...args) {
|
|
114
100
|
const readCb = args.pop();
|
|
115
101
|
return new Computed(readCb, args);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"computed.js","sourceRoot":"","sources":["../../../lib/computed.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"computed.js","sourceRoot":"","sources":["../../../lib/computed.ts"],"names":[],"mappings":";;;AACA,uCAA6D;AAC7D,6CAA+D;AAC/D,2CAA6E;AAE7E,SAAS,QAAQ;IACf,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;AAC1D,CAAC;AAKD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,MAAa,QAAY,SAAQ,uBAAa;IA6BrC,MAAM,CAAC,MAAM,CAAI,KAA0C,EAAE,GAAG,IAAW;QAChF,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAC1B,OAAO,IAAA,yBAAe,EAAC,KAAK,EAAE,IAAI,QAAQ,CAAI,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;IAC/D,CAAC;IAMD,8FAA8F;IAC9F,YAAY,QAA2C,EAAE,YAA6B;QACpF,4FAA4F;QAC5F,qFAAqF;QACrF,KAAK,CAAC,SAAgB,CAAC,CAAC;QACxB,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,IAAI,wBAAY,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC;IAC1E,CAAC;IAED;;;OAGG;IACI,WAAW;QAChB,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;IACjC,CAAC;IAED;;;;OAIG;IACI,GAAG,CAAC,KAAQ,IAAU,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAElD;;;OAGG;IACI,OAAO,CAAC,SAA6B;QAC1C,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;QACxB,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;OAEG;IACI,OAAO;QACZ,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;QACpB,KAAK,CAAC,OAAO,EAAE,CAAC;IAClB,CAAC;IAEO,KAAK,CAAC,GAAQ,EAAE,GAAG,IAAW;QACpC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,GAAY,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC;IACnD,CAAC;CACF;AAnFD,4BAmFC;AAkCD,SAAgB,QAAQ,CAAC,GAAG,IAAW;IACrC,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAC1B,OAAO,IAAI,QAAQ,CAAM,MAAM,EAAE,IAAI,CAAC,CAAC;AACzC,CAAC;AAHD,4BAGC;AAED,kDAAkD;AAClD,2FAA2F;AAC3F,4FAA4F;AAC5F,+EAA+E;AAC/E,EAAE;AACF,yDAAyD;AACzD,wFAAwF;AACxF,oEAAoE;AACpE,qEAAqE;AACrE,uFAAuF;AACvF,kGAAkG;AAClG,oCAAoC"}
|