grainjs 1.0.1 → 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.
Files changed (146) hide show
  1. package/README.md +23 -26
  2. package/dist/cjs/index.js +28 -17
  3. package/dist/cjs/index.js.map +1 -1
  4. package/dist/cjs/lib/PriorityQueue.d.ts +2 -2
  5. package/dist/cjs/lib/PriorityQueue.js +1 -0
  6. package/dist/cjs/lib/PriorityQueue.js.map +1 -1
  7. package/dist/cjs/lib/_computed_queue.js +4 -3
  8. package/dist/cjs/lib/_computed_queue.js.map +1 -1
  9. package/dist/cjs/lib/binding.d.ts +11 -4
  10. package/dist/cjs/lib/binding.js +6 -5
  11. package/dist/cjs/lib/binding.js.map +1 -1
  12. package/dist/cjs/lib/browserGlobals.d.ts +4 -1
  13. package/dist/cjs/lib/browserGlobals.js +2 -0
  14. package/dist/cjs/lib/browserGlobals.js.map +1 -1
  15. package/dist/cjs/lib/computed.d.ts +49 -28
  16. package/dist/cjs/lib/computed.js +38 -51
  17. package/dist/cjs/lib/computed.js.map +1 -1
  18. package/dist/cjs/lib/dispose.d.ts +109 -96
  19. package/dist/cjs/lib/dispose.js +106 -79
  20. package/dist/cjs/lib/dispose.js.map +1 -1
  21. package/dist/cjs/lib/dom.d.ts +40 -18
  22. package/dist/cjs/lib/dom.js +63 -29
  23. package/dist/cjs/lib/dom.js.map +1 -1
  24. package/dist/cjs/lib/domComponent.d.ts +56 -51
  25. package/dist/cjs/lib/domComponent.js +46 -44
  26. package/dist/cjs/lib/domComponent.js.map +1 -1
  27. package/dist/cjs/lib/domComputed.d.ts +50 -20
  28. package/dist/cjs/lib/domComputed.js +37 -7
  29. package/dist/cjs/lib/domComputed.js.map +1 -1
  30. package/dist/cjs/lib/domDispose.d.ts +27 -12
  31. package/dist/cjs/lib/domDispose.js +27 -11
  32. package/dist/cjs/lib/domDispose.js.map +1 -1
  33. package/dist/cjs/lib/domForEach.d.ts +5 -4
  34. package/dist/cjs/lib/domForEach.js +41 -41
  35. package/dist/cjs/lib/domForEach.js.map +1 -1
  36. package/dist/cjs/lib/domImpl.d.ts +33 -10
  37. package/dist/cjs/lib/domImpl.js +29 -9
  38. package/dist/cjs/lib/domImpl.js.map +1 -1
  39. package/dist/cjs/lib/domMethods.d.ts +93 -47
  40. package/dist/cjs/lib/domMethods.js +91 -47
  41. package/dist/cjs/lib/domMethods.js.map +1 -1
  42. package/dist/cjs/lib/domevent.d.ts +87 -62
  43. package/dist/cjs/lib/domevent.js +85 -59
  44. package/dist/cjs/lib/domevent.js.map +1 -1
  45. package/dist/cjs/lib/emit.d.ts +62 -32
  46. package/dist/cjs/lib/emit.js +68 -53
  47. package/dist/cjs/lib/emit.js.map +1 -1
  48. package/dist/cjs/lib/kowrap.d.ts +6 -3
  49. package/dist/cjs/lib/kowrap.js +7 -3
  50. package/dist/cjs/lib/kowrap.js.map +1 -1
  51. package/dist/cjs/lib/obsArray.d.ts +91 -53
  52. package/dist/cjs/lib/obsArray.js +87 -54
  53. package/dist/cjs/lib/obsArray.js.map +1 -1
  54. package/dist/cjs/lib/observable.d.ts +25 -15
  55. package/dist/cjs/lib/observable.js +31 -19
  56. package/dist/cjs/lib/observable.js.map +1 -1
  57. package/dist/cjs/lib/pureComputed.d.ts +12 -15
  58. package/dist/cjs/lib/pureComputed.js +16 -18
  59. package/dist/cjs/lib/pureComputed.js.map +1 -1
  60. package/dist/cjs/lib/styled.d.ts +78 -61
  61. package/dist/cjs/lib/styled.js +27 -79
  62. package/dist/cjs/lib/styled.js.map +1 -1
  63. package/dist/cjs/lib/subscribe.d.ts +41 -37
  64. package/dist/cjs/lib/subscribe.js +31 -39
  65. package/dist/cjs/lib/subscribe.js.map +1 -1
  66. package/dist/cjs/lib/util.js +2 -0
  67. package/dist/cjs/lib/util.js.map +1 -1
  68. package/dist/cjs/lib/widgets/input.d.ts +3 -1
  69. package/dist/cjs/lib/widgets/input.js +7 -4
  70. package/dist/cjs/lib/widgets/input.js.map +1 -1
  71. package/dist/cjs/lib/widgets/select.d.ts +4 -2
  72. package/dist/cjs/lib/widgets/select.js +8 -5
  73. package/dist/cjs/lib/widgets/select.js.map +1 -1
  74. package/dist/esm/lib/_computed_queue.js +3 -3
  75. package/dist/esm/lib/_computed_queue.js.map +1 -1
  76. package/dist/esm/lib/binding.js +2 -2
  77. package/dist/esm/lib/binding.js.map +1 -1
  78. package/dist/esm/lib/browserGlobals.js +1 -0
  79. package/dist/esm/lib/browserGlobals.js.map +1 -1
  80. package/dist/esm/lib/computed.js +36 -50
  81. package/dist/esm/lib/computed.js.map +1 -1
  82. package/dist/esm/lib/dispose.js +104 -78
  83. package/dist/esm/lib/dispose.js.map +1 -1
  84. package/dist/esm/lib/dom.js +40 -18
  85. package/dist/esm/lib/dom.js.map +1 -1
  86. package/dist/esm/lib/domComponent.js +45 -44
  87. package/dist/esm/lib/domComponent.js.map +1 -1
  88. package/dist/esm/lib/domComputed.js +32 -5
  89. package/dist/esm/lib/domComputed.js.map +1 -1
  90. package/dist/esm/lib/domDispose.js +26 -11
  91. package/dist/esm/lib/domDispose.js.map +1 -1
  92. package/dist/esm/lib/domForEach.js +40 -41
  93. package/dist/esm/lib/domForEach.js.map +1 -1
  94. package/dist/esm/lib/domImpl.js +26 -7
  95. package/dist/esm/lib/domImpl.js.map +1 -1
  96. package/dist/esm/lib/domMethods.js +77 -35
  97. package/dist/esm/lib/domMethods.js.map +1 -1
  98. package/dist/esm/lib/domevent.js +84 -59
  99. package/dist/esm/lib/domevent.js.map +1 -1
  100. package/dist/esm/lib/emit.js +67 -53
  101. package/dist/esm/lib/emit.js.map +1 -1
  102. package/dist/esm/lib/kowrap.js +5 -2
  103. package/dist/esm/lib/kowrap.js.map +1 -1
  104. package/dist/esm/lib/obsArray.js +82 -50
  105. package/dist/esm/lib/obsArray.js.map +1 -1
  106. package/dist/esm/lib/observable.js +26 -15
  107. package/dist/esm/lib/observable.js.map +1 -1
  108. package/dist/esm/lib/pureComputed.js +15 -18
  109. package/dist/esm/lib/pureComputed.js.map +1 -1
  110. package/dist/esm/lib/styled.js +24 -77
  111. package/dist/esm/lib/styled.js.map +1 -1
  112. package/dist/esm/lib/subscribe.js +27 -36
  113. package/dist/esm/lib/subscribe.js.map +1 -1
  114. package/dist/esm/lib/util.js +1 -0
  115. package/dist/esm/lib/util.js.map +1 -1
  116. package/dist/esm/lib/widgets/input.js +3 -1
  117. package/dist/esm/lib/widgets/input.js.map +1 -1
  118. package/dist/esm/lib/widgets/select.js +3 -1
  119. package/dist/esm/lib/widgets/select.js.map +1 -1
  120. package/dist/grain-full.debug.js +2138 -3052
  121. package/dist/grain-full.debug.js.map +7 -0
  122. package/dist/grain-full.min.js +6 -2
  123. package/dist/grain-full.min.js.map +7 -1
  124. package/lib/binding.ts +9 -2
  125. package/lib/browserGlobals.ts +3 -1
  126. package/lib/computed.ts +56 -56
  127. package/lib/dispose.ts +110 -85
  128. package/lib/dom.ts +41 -20
  129. package/lib/domComponent.ts +68 -70
  130. package/lib/domComputed.ts +66 -21
  131. package/lib/domDispose.ts +28 -11
  132. package/lib/domForEach.ts +13 -12
  133. package/lib/domImpl.ts +30 -7
  134. package/lib/domMethods.ts +101 -46
  135. package/lib/domevent.ts +86 -61
  136. package/lib/emit.ts +64 -50
  137. package/lib/kowrap.ts +5 -2
  138. package/lib/obsArray.ts +89 -54
  139. package/lib/observable.ts +26 -15
  140. package/lib/pureComputed.ts +16 -22
  141. package/lib/styled.ts +85 -71
  142. package/lib/subscribe.ts +41 -45
  143. package/lib/util.ts +1 -0
  144. package/lib/widgets/input.ts +3 -1
  145. package/lib/widgets/select.ts +3 -1
  146. package/package.json +48 -38
package/README.md CHANGED
@@ -1,41 +1,38 @@
1
- # GrainJS
1
+ # GrainJS: a light typescript web framework
2
2
 
3
3
  [![npm version](https://badge.fury.io/js/grainjs.svg)](https://badge.fury.io/js/grainjs)
4
- [![Build Status](https://travis-ci.org/gristlabs/grainjs.svg?branch=master)](https://travis-ci.org/gristlabs/grainjs)
4
+ [![Build status](https://github.com/gristlabs/grainjs/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/gristlabs/grainjs/actions/workflows/build-and-test.yml)
5
+ [![codecov](https://codecov.io/gh/gristlabs/grainjs/branch/main/graph/badge.svg?token=1OIMMBLI6N)](https://codecov.io/gh/gristlabs/grainjs)
5
6
 
6
- GrainJS is a Javascript (and TypeScript) library for building highly performant dynamic
7
- applications.
7
+ GrainJS is a JavaScript / TypeScript library for building dynamic web applications.
8
8
 
9
- GrainJS provides convenient pure-JS interfaces for building DOM. It has observables inspired by
10
- [Knockout](http://knockoutjs.com/documentation/introduction.html) to create declarative data
11
- models and tie them to UI. It includes light-weight event dispatching, DOM event subscriptions,
12
- disposable components, and in-code CSS styling.
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
- GrainJS is in part inspired by [React](https://reactjs.org/), but based on observables instead of
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
- The focus is on performance and conciseness. The library has no dependencies and is only 25K
19
- minified.
21
+ For docs, visit [https://gristlabs.github.io/grainjs/](https://gristlabs.github.io/grainjs/).
20
22
 
21
23
  ## Installation
22
24
 
23
- ```
24
- npm install --save grainjs
25
+ ```sh
26
+ npm install grainjs
25
27
  ```
26
28
 
27
- ## Usage
29
+ Or see [Getting started with GrainJS](https://gristlabs.github.io/grainjs/getting-started.html).
28
30
 
29
- Until proper documentation pages are created, see documentation in individual code files under the
30
- `lib` directory.
31
+ ## Examples
31
32
 
32
- Example:
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).
33
35
 
34
- ```typescript
35
- const name = observable("");
36
+ ## License
36
37
 
37
- dom.update(document.body,
38
- input(name, {onInput: true}, {type: "text", placeholder: "Your name..."),
39
- dom("div.name-class", "Hello, ", dom.text(name), "!"),
40
- );
41
- ```
38
+ GrainJS is licensed under [Apache-2.0 license](https://github.com/gristlabs/grainjs/blob/main/LICENSE).
package/dist/cjs/index.js CHANGED
@@ -1,20 +1,31 @@
1
1
  "use strict";
2
- function __export(m) {
3
- for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
4
- }
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
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);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
5
16
  Object.defineProperty(exports, "__esModule", { value: true });
6
- __export(require("./lib/binding"));
7
- __export(require("./lib/computed"));
8
- __export(require("./lib/dispose"));
9
- __export(require("./lib/dom"));
10
- __export(require("./lib/emit"));
11
- __export(require("./lib/kowrap"));
12
- __export(require("./lib/obsArray"));
13
- __export(require("./lib/observable"));
14
- __export(require("./lib/pureComputed"));
15
- __export(require("./lib/styled"));
16
- __export(require("./lib/subscribe"));
17
- __export(require("./lib/util"));
18
- __export(require("./lib/widgets/input"));
19
- __export(require("./lib/widgets/select"));
17
+ __exportStar(require("./lib/binding"), exports);
18
+ __exportStar(require("./lib/computed"), exports);
19
+ __exportStar(require("./lib/dispose"), exports);
20
+ __exportStar(require("./lib/dom"), exports);
21
+ __exportStar(require("./lib/emit"), exports);
22
+ __exportStar(require("./lib/kowrap"), exports);
23
+ __exportStar(require("./lib/obsArray"), exports);
24
+ __exportStar(require("./lib/observable"), exports);
25
+ __exportStar(require("./lib/pureComputed"), exports);
26
+ __exportStar(require("./lib/styled"), exports);
27
+ __exportStar(require("./lib/subscribe"), exports);
28
+ __exportStar(require("./lib/util"), exports);
29
+ __exportStar(require("./lib/widgets/input"), exports);
30
+ __exportStar(require("./lib/widgets/select"), exports);
20
31
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":";;;;;AAAA,mCAA8B;AAC9B,oCAA+B;AAC/B,mCAA8B;AAC9B,+BAA0B;AAC1B,gCAA2B;AAC3B,kCAA6B;AAC7B,oCAA+B;AAC/B,sCAAiC;AACjC,wCAAmC;AACnC,kCAA6B;AAC7B,qCAAgC;AAChC,gCAA2B;AAC3B,yCAAoC;AACpC,0CAAqC"}
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,12 +6,12 @@
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 declare type IsPriorFunc<T> = (a: T, b: T) => boolean;
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;
13
13
  constructor(_isPrior: IsPriorFunc<T>);
14
- readonly size: number;
14
+ get size(): number;
15
15
  push(item: T): void;
16
16
  peek(): T | undefined;
17
17
  pop(): T | undefined;
@@ -8,6 +8,7 @@
8
8
  * returns the most-prior element.
9
9
  */
10
10
  Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.PriorityQueue = void 0;
11
12
  class PriorityQueue {
12
13
  constructor(_isPrior) {
13
14
  this._isPrior = _isPrior;
@@ -1 +1 @@
1
- {"version":3,"file":"PriorityQueue.js","sourceRoot":"","sources":["../../../lib/PriorityQueue.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;AAIH,MAAa,aAAa;IAMxB,YAAoB,QAAwB;QAAxB,aAAQ,GAAR,QAAQ,CAAgB;QAL5C,4FAA4F;QAC5F,8FAA8F;QAC9F,8CAA8C;QACtC,WAAM,GAAQ,EAAE,CAAC;IAEsB,CAAC;IAEhD,IAAW,IAAI,KAAa,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IAEjD,IAAI,CAAC,IAAO;QACjB,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC;QAC1B,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC;QAE9B,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;QAChC,OAAO,MAAM,GAAG,CAAC,EAAE;YACjB,wFAAwF;YACxF,MAAM,MAAM,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAG,iCAAiC;YACrE,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;YAC9B,IAAI,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE;gBAC1B,MAAM;aACP;YACD,KAAK,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC;YACxB,MAAM,GAAG,MAAM,CAAC;SACjB;QACD,KAAK,CAAC,MAAM,CAAC,GAAG,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AAC;QAC9B,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QAExB,gDAAgD;QAChD,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,EAAG,CAAC;QAC1B,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;QAChC,IAAI,MAAM,GAAG,CAAC,CAAC;QACf,IAAI,OAAO,GAAG,CAAC,CAAC;QAChB,OAAO,OAAO,GAAG,IAAI,EAAE;YACrB,MAAM,QAAQ,GAAG,OAAO,GAAG,CAAC,CAAC;YAC7B,MAAM,OAAO,GAAG,CAAC,QAAQ,GAAG,IAAI,IAAI,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC7E,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC;YACrB,IAAI,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE;gBACjC,MAAM;aACP;YACD,KAAK,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;YAC/B,MAAM,GAAG,OAAO,CAAC;YACjB,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,CAAC,CAAC;SAC/B;QACD,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;QACrB,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAzDD,sCAyDC"}
@@ -17,12 +17,16 @@
17
17
  * call, or of bundleChanges() call, the queue gets processed in order of _priority.
18
18
  */
19
19
  Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.bundleChanges = exports.compute = exports._getPriority = exports.DepItem = void 0;
20
21
  const PriorityQueue_1 = require("./PriorityQueue");
21
22
  /**
22
23
  * DepItem is an item in a dependency relationship. It may depend on other DepItems. It is used
23
24
  * for subscriptions and computed observables.
24
25
  */
25
26
  class DepItem {
27
+ static isPrioritySmaller(a, b) {
28
+ return a._priority < b._priority || (a._priority === b._priority && a._creation < b._creation);
29
+ }
26
30
  /**
27
31
  * Callback should call depItem.useDep(dep) for each DepInput it depends on.
28
32
  */
@@ -34,9 +38,6 @@ class DepItem {
34
38
  this._callback = callback;
35
39
  this._context = optContext;
36
40
  }
37
- static isPrioritySmaller(a, b) {
38
- return a._priority < b._priority || (a._priority === b._priority && a._creation < b._creation);
39
- }
40
41
  /**
41
42
  * Mark depItem as a dependency of this DepItem. The argument may be null to indicate a leaf (an
42
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;IAalB;;OAEG;IACH,YAAY,QAAoB,EAAE,UAAmB;QAX7C,cAAS,GAAW,CAAC,CAAC;QACtB,cAAS,GAAY,KAAK,CAAC;QAInC,+DAA+D;QACvD,cAAS,GAAW,EAAE,gBAAgB,CAAC;QAM7C,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,QAAQ,GAAG,UAAU,CAAC;IAC7B,CAAC;IAlBM,MAAM,CAAC,iBAAiB,CAAC,CAAU,EAAE,CAAU;QACpD,OAAO,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,CAAC,SAAS,KAAK,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC;IACjG,CAAC;IAkBD;;;OAGG;IACI,MAAM,CAAC,OAAqB;QACjC,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;QAC1C,IAAI,CAAC,IAAI,IAAI,CAAC,SAAS,EAAE;YACvB,IAAI,CAAC,SAAS,GAAG,CAAC,GAAG,CAAC,CAAC;SACxB;IAC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,IAAI,GAAG,CAAC,EAAE;SAC1B;gBAAS;YACR,2FAA2F;YAC3F,0DAA0D;YAC1D,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;gBACxB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;aACxB;YACD,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;YACjB,WAAW,EAAE,CAAC;SACf;KACF;AACH,CAAC;AArBD,0BAqBC;AAED;;;;;;;GAOG;AACH,SAAgB,aAAa,CAAI,IAAa;IAC5C,IAAI;QACF,WAAW,EAAE,CAAC;QACd,OAAO,IAAI,EAAE,CAAC;KACf;YAAS;QACR,WAAW,EAAE,CAAC;QACd,OAAO,EAAE,CAAC;KACX;AACH,CAAC;AARD,sCAQC"}
@@ -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
- export declare type BindableValue<T> = BaseObservable<T> | ComputedCallback<T> | T | IKnockoutReadObservable<T>;
10
- export declare type ComputedCallback<T> = (use: UseCBOwner, ...args: any[]) => T;
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
- * subscribe(), and disposes the subscription with the passed-in element.
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;
@@ -4,6 +4,7 @@
4
4
  * a plain value, or a function from which it builds a computed.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.subscribeElem = exports.subscribeBindable = void 0;
7
8
  const computed_1 = require("./computed");
8
9
  const domDispose_1 = require("./domDispose");
9
10
  const observable_1 = require("./observable");
@@ -22,7 +23,7 @@ function subscribeBindable(valueObs, callback) {
22
23
  // let sub = subscribe(use => callback(valueObs(use)));
23
24
  // The difference is that when valueObs() evaluates to unchanged value, callback would be
24
25
  // called in the version above, but not in the version below.
25
- const comp = computed_1.computed(valueObs);
26
+ const comp = (0, computed_1.computed)(valueObs);
26
27
  comp.addListener((val) => callback(val));
27
28
  callback(comp.get());
28
29
  return comp; // Disposing this will dispose its one listener.
@@ -31,18 +32,18 @@ function subscribeBindable(valueObs, callback) {
31
32
  if (valueObs instanceof observable_1.BaseObservable) {
32
33
  // Use subscribe() rather than addListener(), so that bundling of changes (implicit and with
33
34
  // bundleChanges()) is respected. This matters when callback also uses observables.
34
- return subscribe_1.subscribe(valueObs, (use, val) => callback(val));
35
+ return (0, subscribe_1.subscribe)(valueObs, (use, val) => callback(val));
35
36
  }
36
37
  callback(valueObs);
37
38
  return null;
38
39
  }
39
40
  exports.subscribeBindable = subscribeBindable;
40
41
  /**
41
- * Subscribes a callback to valueObs (which may be a value, observable, or function) using
42
- * subscribe(), and disposes the subscription with the passed-in element.
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.
43
44
  */
44
45
  function subscribeElem(elem, valueObs, callback) {
45
- domDispose_1.autoDisposeElem(elem, subscribeBindable(valueObs, callback));
46
+ (0, domDispose_1.autoDisposeElem)(elem, subscribeBindable(valueObs, callback));
46
47
  }
47
48
  exports.subscribeElem = subscribeElem;
48
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;AAsBlD,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,mBAAQ,CAAC,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,OA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AAO,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"}
@@ -25,11 +25,14 @@ export interface IBrowserGlobals {
25
25
  document: typeof document;
26
26
  window: typeof window;
27
27
  }
28
+ export interface IBrowserGlobalsLax extends IBrowserGlobals {
29
+ window: any;
30
+ }
28
31
  export declare const G: IBrowserGlobals;
29
32
  /**
30
33
  * Replace globals with those from the given object. Use popGlobals() to restore previous values.
31
34
  */
32
- export declare function pushGlobals(globals: IBrowserGlobals): void;
35
+ export declare function pushGlobals(globals: IBrowserGlobalsLax): void;
33
36
  /**
34
37
  * Restore the values of globals to undo the preceding pushGlobals() call.
35
38
  */
@@ -20,6 +20,8 @@
20
20
  * });
21
21
  */
22
22
  Object.defineProperty(exports, "__esModule", { value: true });
23
+ exports.popGlobals = exports.pushGlobals = exports.G = void 0;
24
+ ;
23
25
  function _updateGlobals(dest, source) {
24
26
  dest.DocumentFragment = source.DocumentFragment;
25
27
  dest.Element = source.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"browserGlobals.js","sourceRoot":"","sources":["../../../lib/browserGlobals.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;AAUH,SAAS,cAAc,CAAC,IAAqB,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AgB,CAAC;IACjD,IAAI,CAAC,OAAO,GAAa,MAAM,CAAC,OAAO,CAAC;IACxC,IAAI,CAAC,IAAI,GAAgB,MAAM,CAAC,IAAI,CAAC;IACrC,IAAI,CAAC,QAAQ,GAAY,MAAM,CAAC,QAAQ,CAAC;IACzC,IAAI,CAAC,MAAM,GAAc,MAAM,CAAC,MAAM,CAAC;AACzC,CAAC;AAED,sCAAsC;AACtC,MAAM,OAAO,GAAoB,EAAqB,CAAC;AACvD,cAAc,CAAC,OAAO,EAAE,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,MAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAE9E,4DAA4D;AAC/C,QAAA,CAAC,qBAAyB,OAAO,EAAG;AAEjD,uFAAuF;AACvF,MAAM,aAAa,GAAsB,CAAC,OAAO,CAAC,CAAC;AAEnD;;GAEG;AACH,SAAgB,WAAW,CAAC,OAA2B;IACrD,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC5B,cAAc,CAAC,SAAC,EAAE,OAAO,CAAC,CAAC;AAC7B,CAAC;AAHD,kCAGC;AAED;;GAEG;AACH,SAAgB,UAAU;IACxB,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE;QAC5B,aAAa,CAAC,GAAG,EAAE,CAAC;KACrB;IACD,cAAc,CAAC,SAAC,EAAE,aAAa,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;AAC7D,CAAC;AALD,gCAKC"}
@@ -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
- * computed.js implements a computed observable, whose value depends on other observables and gets
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 `computed`),
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
- * let obs1 = observable(5), obs2 = observable(12);
8
- * let computed1 = computed(obs1, obs2, (use, v1, v2) => v1 + v2);
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
- * let computed2 = computed(use => use(obs1) + use(obs2));
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 obs2 is
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(). Note that constructor dependencies have less overhead.
19
- *
20
- * let val = computed(...deps, ((use, ...depValues) => READ_CALLBACK));
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 pureComputed.js offers a variation of computed() with the same interface, but which
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
- * let val = computed((use) => Foo.create(use.owner, use(a), use(b)));
41
+ * ```ts
42
+ * const val = Computed.create(null, ((use) => Foo.create(use.owner, use(a), use(b)));
43
+ * ```
31
44
  *
32
- * When the computed() is re-evaluated, and when it itself is disposed, it disposes the previously
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 {Object} value: The value to pass to the write() callback.
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
- * This is the type-checking interface for computed(), which allows TypeScript to do helpful
78
- * type-checking when using it. We can only support a fixed number of argumnets (explicit
79
- * dependencies), but 5 should almost always be enough.
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>;
@@ -1,50 +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
- * computed.js implements a computed observable, whose value depends on other observables and gets
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 `computed`),
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
- * let obs1 = observable(5), obs2 = observable(12);
9
- * let computed1 = computed(obs1, obs2, (use, v1, v2) => v1 + v2);
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
- * let computed2 = computed(use => use(obs1) + use(obs2));
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 obs2 is
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(). Note that constructor dependencies have less overhead.
20
- *
21
- * let val = computed(...deps, ((use, ...depValues) => READ_CALLBACK));
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 pureComputed.js offers a variation of computed() with the same interface, but which
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
- * let val = computed((use) => Foo.create(use.owner, use(a), use(b)));
44
+ * ```ts
45
+ * const val = Computed.create(null, ((use) => Foo.create(use.owner, use(a), use(b)));
46
+ * ```
32
47
  *
33
- * When the computed() is re-evaluated, and when it itself is disposed, it disposes the previously
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
- const dispose_1 = require("./dispose");
39
- const observable_1 = require("./observable");
40
- const subscribe_1 = require("./subscribe");
41
- function _noWrite() {
42
- throw new Error("Can't write to non-writable computed");
43
- }
44
52
  class Computed extends observable_1.Observable {
45
- /**
46
- * Internal constructor for a Computed observable. You should use computed() function instead.
47
- */
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.
48
58
  constructor(callback, dependencies) {
49
59
  // At initialization we force an undefined value even though it's not of type T: it gets set
50
60
  // to a proper value during the creation of new Subscription, which calls this._read.
@@ -53,22 +63,9 @@ class Computed extends observable_1.Observable {
53
63
  this._write = _noWrite;
54
64
  this._sub = new subscribe_1.Subscription(this._read.bind(this), dependencies, this);
55
65
  }
56
- /**
57
- * Creates a new Computed, owned by the given owner.
58
- * @param owner: Object to own this Computed, or null to handle disposal manually.
59
- * @param ...observables: Zero or more observables on which this computes depends. The callback
60
- * will get called when any of these changes.
61
- * @param callback: Read callback that will be called with (use, ...values),
62
- * i.e. the `use` function and values for all of the ...observables. The callback is called
63
- * immediately and whenever any dependency changes.
64
- * @returns {Computed} The newly created computed observable.
65
- */
66
- static create(owner, ...args) {
67
- const readCb = args.pop();
68
- return dispose_1.setDisposeOwner(owner, new Computed(readCb, args));
69
- }
70
66
  /**
71
67
  * Used by subscriptions to keep track of dependencies.
68
+ * @internal
72
69
  */
73
70
  _getDepItem() {
74
71
  return this._sub._getDepItem();
@@ -76,7 +73,7 @@ class Computed extends observable_1.Observable {
76
73
  /**
77
74
  * "Sets" the value of the computed by calling the write() callback if one was provided in the
78
75
  * constructor. Throws an error if there was no such callback (not a "writable" computed).
79
- * @param {Object} value: The value to pass to the write() callback.
76
+ * @param value - The value to pass to the write() callback.
80
77
  */
81
78
  set(value) { this._write(value); }
82
79
  /**
@@ -99,16 +96,6 @@ class Computed extends observable_1.Observable {
99
96
  }
100
97
  }
101
98
  exports.Computed = Computed;
102
- /**
103
- * Creates a new Computed.
104
- * @param {Observable} ...observables: The initial params, of which there may be zero or more, are
105
- * observables on which this computed depends. When any of them change, the read() callback
106
- * will be called with the values of these observables as arguments.
107
- * @param {Function} readCallback: Read callback that will be called with (use, ...values),
108
- * i.e. the `use` function and values for all of the ...observables. The callback is called
109
- * immediately and whenever any dependency changes.
110
- * @returns {Computed} The newly created computed observable.
111
- */
112
99
  function computed(...args) {
113
100
  const readCb = args.pop();
114
101
  return new Computed(readCb, args);
@@ -1 +1 @@
1
- {"version":3,"file":"computed.js","sourceRoot":"","sources":["../../../lib/computed.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;;AAGH,uCAA6D;AAC7D,6CAA+D;AAC/D,2CAA6E;AAE7E,SAAS,QAAQ;IACf,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;AAC1D,CAAC;AAID,MAAa,QAAY,SAAQ,uBAAa;IAuC5C;;OAEG;IACH,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,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