@thi.ng/transducers-hdom 3.1.34 → 3.1.35
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/CHANGELOG.md +1 -1
- package/index.d.ts +24 -24
- package/index.js +24 -24
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
package/index.d.ts
CHANGED
|
@@ -2,37 +2,37 @@ import type { HDOMImplementation, HDOMOpts } from "@thi.ng/hdom";
|
|
|
2
2
|
import type { Transducer } from "@thi.ng/transducers";
|
|
3
3
|
/**
|
|
4
4
|
* Side-effecting & stateful transducer which receives {@link
|
|
5
|
-
* @thi.ng/hdom} component trees, diffs each against previous value and
|
|
6
|
-
*
|
|
7
|
-
* element.
|
|
5
|
+
* @thi.ng/hdom} component trees, diffs each against previous value and applies
|
|
6
|
+
* required changes to browser DOM starting at given root element.
|
|
8
7
|
*
|
|
9
8
|
* By default, incoming values are first normalized using hdom's
|
|
10
|
-
*
|
|
11
|
-
* (optional) `ctx` object is provided to all
|
|
12
|
-
* functions in the tree. If the `autoDerefKeys` option is
|
|
13
|
-
* attempts to auto-expand/deref the given keys in the user supplied
|
|
14
|
-
* context object (`ctx` option) prior to *each* tree normalization. All
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
9
|
+
* [`normalizeTree()`](https://docs.thi.ng/umbrella/hdom/functions/normalizeTree.html)
|
|
10
|
+
* function and a copy of the given (optional) `ctx` object is provided to all
|
|
11
|
+
* embedded component functions in the tree. If the `autoDerefKeys` option is
|
|
12
|
+
* given, attempts to auto-expand/deref the given keys in the user supplied
|
|
13
|
+
* context object (`ctx` option) prior to *each* tree normalization. All of
|
|
14
|
+
* these values should implement the
|
|
15
|
+
* [`IDeref`](https://docs.thi.ng/umbrella/api/interfaces/IDeref.html) interface
|
|
16
|
+
* (e.g. atoms, cursors, views, rstreams etc.). This feature can be used to
|
|
17
|
+
* define dynamic contexts linked to the main app state, e.g. using derived
|
|
18
|
+
* views provided by [`thi.ng/atom`](https://thi.ng/atom).
|
|
19
19
|
*
|
|
20
|
-
* If the `hydrate` option is given, the first received tree is only
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* otherwise identical, pre-existing DOM. All succeeding
|
|
24
|
-
* diffed then as usual.
|
|
20
|
+
* If the `hydrate` option is given, the first received tree is only used to
|
|
21
|
+
* inject event listeners and initialize components with lifecycle
|
|
22
|
+
* [`ILifecycle.init()`](https://docs.thi.ng/umbrella/hdom/interfaces/ILifecycle.html#init)
|
|
23
|
+
* methods and expects an otherwise identical, pre-existing DOM. All succeeding
|
|
24
|
+
* trees are diffed then as usual.
|
|
25
25
|
*
|
|
26
|
-
* This transducer is primarily intended for
|
|
27
|
-
* dataflow graph based applications,
|
|
28
|
-
*
|
|
29
|
-
* without using the usual RAF update loop used by
|
|
30
|
-
* this setup, DOM updates will only be performed when the
|
|
31
|
-
* transducer is attached to emits new values (i.e. hdom component
|
|
26
|
+
* This transducer is primarily intended for
|
|
27
|
+
* [`thi.ng/rstream`](https://thi.ng/rstream) dataflow graph based applications,
|
|
28
|
+
* where it can be used as final leaf subscription to reactively reflect UI
|
|
29
|
+
* changes back to the user, without using the usual RAF update loop used by
|
|
30
|
+
* hdom by default. In this setup, DOM updates will only be performed when the
|
|
31
|
+
* stream this transducer is attached to emits new values (i.e. hdom component
|
|
32
32
|
* trees).
|
|
33
33
|
*
|
|
34
34
|
* Please see here for further details:
|
|
35
|
-
*
|
|
35
|
+
* [`start()`](https://docs.thi.ng/umbrella/hdom/functions/start.html)
|
|
36
36
|
*
|
|
37
37
|
* @param opts - hdom options
|
|
38
38
|
*/
|
package/index.js
CHANGED
|
@@ -4,37 +4,37 @@ import { derefContext } from "@thi.ng/hiccup/deref";
|
|
|
4
4
|
import { scan } from "@thi.ng/transducers/scan";
|
|
5
5
|
/**
|
|
6
6
|
* Side-effecting & stateful transducer which receives {@link
|
|
7
|
-
* @thi.ng/hdom} component trees, diffs each against previous value and
|
|
8
|
-
*
|
|
9
|
-
* element.
|
|
7
|
+
* @thi.ng/hdom} component trees, diffs each against previous value and applies
|
|
8
|
+
* required changes to browser DOM starting at given root element.
|
|
10
9
|
*
|
|
11
10
|
* By default, incoming values are first normalized using hdom's
|
|
12
|
-
*
|
|
13
|
-
* (optional) `ctx` object is provided to all
|
|
14
|
-
* functions in the tree. If the `autoDerefKeys` option is
|
|
15
|
-
* attempts to auto-expand/deref the given keys in the user supplied
|
|
16
|
-
* context object (`ctx` option) prior to *each* tree normalization. All
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
11
|
+
* [`normalizeTree()`](https://docs.thi.ng/umbrella/hdom/functions/normalizeTree.html)
|
|
12
|
+
* function and a copy of the given (optional) `ctx` object is provided to all
|
|
13
|
+
* embedded component functions in the tree. If the `autoDerefKeys` option is
|
|
14
|
+
* given, attempts to auto-expand/deref the given keys in the user supplied
|
|
15
|
+
* context object (`ctx` option) prior to *each* tree normalization. All of
|
|
16
|
+
* these values should implement the
|
|
17
|
+
* [`IDeref`](https://docs.thi.ng/umbrella/api/interfaces/IDeref.html) interface
|
|
18
|
+
* (e.g. atoms, cursors, views, rstreams etc.). This feature can be used to
|
|
19
|
+
* define dynamic contexts linked to the main app state, e.g. using derived
|
|
20
|
+
* views provided by [`thi.ng/atom`](https://thi.ng/atom).
|
|
21
21
|
*
|
|
22
|
-
* If the `hydrate` option is given, the first received tree is only
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* otherwise identical, pre-existing DOM. All succeeding
|
|
26
|
-
* diffed then as usual.
|
|
22
|
+
* If the `hydrate` option is given, the first received tree is only used to
|
|
23
|
+
* inject event listeners and initialize components with lifecycle
|
|
24
|
+
* [`ILifecycle.init()`](https://docs.thi.ng/umbrella/hdom/interfaces/ILifecycle.html#init)
|
|
25
|
+
* methods and expects an otherwise identical, pre-existing DOM. All succeeding
|
|
26
|
+
* trees are diffed then as usual.
|
|
27
27
|
*
|
|
28
|
-
* This transducer is primarily intended for
|
|
29
|
-
* dataflow graph based applications,
|
|
30
|
-
*
|
|
31
|
-
* without using the usual RAF update loop used by
|
|
32
|
-
* this setup, DOM updates will only be performed when the
|
|
33
|
-
* transducer is attached to emits new values (i.e. hdom component
|
|
28
|
+
* This transducer is primarily intended for
|
|
29
|
+
* [`thi.ng/rstream`](https://thi.ng/rstream) dataflow graph based applications,
|
|
30
|
+
* where it can be used as final leaf subscription to reactively reflect UI
|
|
31
|
+
* changes back to the user, without using the usual RAF update loop used by
|
|
32
|
+
* hdom by default. In this setup, DOM updates will only be performed when the
|
|
33
|
+
* stream this transducer is attached to emits new values (i.e. hdom component
|
|
34
34
|
* trees).
|
|
35
35
|
*
|
|
36
36
|
* Please see here for further details:
|
|
37
|
-
*
|
|
37
|
+
* [`start()`](https://docs.thi.ng/umbrella/hdom/functions/start.html)
|
|
38
38
|
*
|
|
39
39
|
* @param opts - hdom options
|
|
40
40
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/transducers-hdom",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.35",
|
|
4
4
|
"description": "Transducer based UI updater for @thi.ng/hdom",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
"test": "testament test"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@thi.ng/hdom": "^9.2.
|
|
38
|
-
"@thi.ng/hiccup": "^4.2.
|
|
39
|
-
"@thi.ng/transducers": "^8.3.
|
|
37
|
+
"@thi.ng/hdom": "^9.2.1",
|
|
38
|
+
"@thi.ng/hiccup": "^4.2.27",
|
|
39
|
+
"@thi.ng/transducers": "^8.3.27"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@microsoft/api-extractor": "^7.33.7",
|
|
@@ -79,5 +79,5 @@
|
|
|
79
79
|
],
|
|
80
80
|
"year": 2018
|
|
81
81
|
},
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "7b2af448da8a63fb21704a79cc4cdf1f3d7d7a64\n"
|
|
83
83
|
}
|