@thi.ng/csp 2.1.102 → 2.1.104
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/README.md +8 -2
- package/package.json +10 -9
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -185,11 +185,14 @@ paths.into(["src/channel.ts", "src/mult.ts", "src/pubsub.ts"]);
|
|
|
185
185
|
### Channel merging
|
|
186
186
|
|
|
187
187
|
```ts
|
|
188
|
+
import { Channel } from "@thi.ng/csp";
|
|
189
|
+
import { push } from "@thi.ng/transducers";
|
|
190
|
+
|
|
188
191
|
Channel.merge([
|
|
189
192
|
Channel.range(0, 3),
|
|
190
193
|
Channel.range(10, 15),
|
|
191
194
|
Channel.range(100, 110)
|
|
192
|
-
]).reduce(
|
|
195
|
+
]).reduce(push()).then(console.log);
|
|
193
196
|
|
|
194
197
|
// [ 0, 100, 101, 102, 103, 1, 2, 104, 105, 10, 11, 12, 13, 106, 14, 107, 108, 109 ]
|
|
195
198
|
|
|
@@ -226,10 +229,13 @@ Channel.mergeTuples([
|
|
|
226
229
|
### PubSub
|
|
227
230
|
|
|
228
231
|
```ts
|
|
232
|
+
import { Channel, PubSub } from "@thi.ng/csp";
|
|
233
|
+
import { map } from "@thi.ng/transducers";
|
|
234
|
+
|
|
229
235
|
// define a channel publisher with transducer and topic function applied to each item
|
|
230
236
|
// the input channel receives names and transforms them into indexable objects
|
|
231
237
|
const pub = new PubSub(
|
|
232
|
-
new Channel<any>("users",
|
|
238
|
+
new Channel<any>("users", map((x: string) => ({ type: x.charAt(0), val: x }))),
|
|
233
239
|
(x) => x.type
|
|
234
240
|
);
|
|
235
241
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/csp",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.104",
|
|
4
4
|
"description": "ES6 promise based CSP primitives & operations",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -36,15 +36,16 @@
|
|
|
36
36
|
"testasync": "tsc -p test && node build/test/async.js",
|
|
37
37
|
"testfile": "tsc -p test && node build/test/file.js",
|
|
38
38
|
"testgraph": "tsc -p test && node build/test/graph.js",
|
|
39
|
-
"testnode": "tsc -p test && node build/test/node.js"
|
|
39
|
+
"testnode": "tsc -p test && node build/test/node.js",
|
|
40
|
+
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
40
41
|
},
|
|
41
42
|
"dependencies": {
|
|
42
|
-
"@thi.ng/api": "^8.9.
|
|
43
|
-
"@thi.ng/arrays": "^2.8.
|
|
44
|
-
"@thi.ng/checks": "^3.5.
|
|
45
|
-
"@thi.ng/dcons": "^3.2.
|
|
46
|
-
"@thi.ng/errors": "^2.4.
|
|
47
|
-
"@thi.ng/transducers": "^8.9.
|
|
43
|
+
"@thi.ng/api": "^8.9.28",
|
|
44
|
+
"@thi.ng/arrays": "^2.8.6",
|
|
45
|
+
"@thi.ng/checks": "^3.5.2",
|
|
46
|
+
"@thi.ng/dcons": "^3.2.99",
|
|
47
|
+
"@thi.ng/errors": "^2.4.20",
|
|
48
|
+
"@thi.ng/transducers": "^8.9.10"
|
|
48
49
|
},
|
|
49
50
|
"devDependencies": {
|
|
50
51
|
"@microsoft/api-extractor": "^7.40.1",
|
|
@@ -103,5 +104,5 @@
|
|
|
103
104
|
"status": "deprecated",
|
|
104
105
|
"year": 2016
|
|
105
106
|
},
|
|
106
|
-
"gitHead": "
|
|
107
|
+
"gitHead": "a421058a65ba76608d94129ac29451bfedaf201c\n"
|
|
107
108
|
}
|