@thi.ng/fibers 0.5.4 → 0.5.5
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 +7 -1
- package/README.md +2 -1
- package/ops.d.ts +2 -1
- package/ops.js +3 -2
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
- **Last updated**: 2023-10-
|
|
3
|
+
- **Last updated**: 2023-10-18T18:06:31Z
|
|
4
4
|
- **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
|
|
5
5
|
|
|
6
6
|
All notable changes to this project will be documented in this file.
|
|
@@ -9,6 +9,12 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
|
|
|
9
9
|
**Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
|
|
10
10
|
and/or version bumps of transitive dependencies.
|
|
11
11
|
|
|
12
|
+
### [0.5.5](https://github.com/thi-ng/umbrella/tree/@thi.ng/fibers@0.5.5) (2023-10-18)
|
|
13
|
+
|
|
14
|
+
#### 🩹 Bug fixes
|
|
15
|
+
|
|
16
|
+
- add opts arg for untilPromise() ([acf5ddf](https://github.com/thi-ng/umbrella/commit/acf5ddf))
|
|
17
|
+
|
|
12
18
|
## [0.5.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/fibers@0.5.0) (2023-09-17)
|
|
13
19
|
|
|
14
20
|
#### 🚀 Features
|
package/README.md
CHANGED
|
@@ -378,7 +378,7 @@ For Node.js REPL:
|
|
|
378
378
|
const fibers = await import("@thi.ng/fibers");
|
|
379
379
|
```
|
|
380
380
|
|
|
381
|
-
Package sizes (brotli'd, pre-treeshake): ESM: 2.
|
|
381
|
+
Package sizes (brotli'd, pre-treeshake): ESM: 2.40 KB
|
|
382
382
|
|
|
383
383
|
## Dependencies
|
|
384
384
|
|
|
@@ -406,6 +406,7 @@ A selection:
|
|
|
406
406
|
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/ifs-fractal.jpg" width="240"/> | Barnsley fern IFS fractal renderer | [Demo](https://demo.thi.ng/umbrella/ifs-fractal/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/ifs-fractal) |
|
|
407
407
|
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/mastodon-feed.jpg" width="240"/> | Mastodon API feed reader with support for different media types, fullscreen media modal, HTML rewriting | [Demo](https://demo.thi.ng/umbrella/mastodon-feed/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/mastodon-feed) |
|
|
408
408
|
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/poly-subdiv.jpg" width="240"/> | Animated, iterative polygon subdivisions & visualization | [Demo](https://demo.thi.ng/umbrella/poly-subdiv/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/poly-subdiv) |
|
|
409
|
+
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/related-images.jpg" width="240"/> | Responsive image gallery with tag-based Jaccard similarity ranking | [Demo](https://demo.thi.ng/umbrella/related-images/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/related-images) |
|
|
409
410
|
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/render-audio.png" width="240"/> | Generative audio synth offline renderer and WAV file export | [Demo](https://demo.thi.ng/umbrella/render-audio/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/render-audio) |
|
|
410
411
|
|
|
411
412
|
## API
|
package/ops.d.ts
CHANGED
|
@@ -136,8 +136,9 @@ export declare function untilState<T>(state: T, pred: Predicate<T>): Generator<u
|
|
|
136
136
|
* and the fiber removed from the parent. See {@link Fiber.next} for details.
|
|
137
137
|
*
|
|
138
138
|
* @param promise
|
|
139
|
+
* @param opts
|
|
139
140
|
*/
|
|
140
|
-
export declare const untilPromise: <T>(promise: PromiseLike<T>) => Fiber<T>;
|
|
141
|
+
export declare const untilPromise: <T>(promise: PromiseLike<T>, opts?: Partial<FiberOpts>) => Fiber<T>;
|
|
141
142
|
/**
|
|
142
143
|
* Returns fiber which attaches a one-off event handler for event `type` to
|
|
143
144
|
* `target` and then "blocks" until the event occurred.
|
package/ops.js
CHANGED
|
@@ -201,8 +201,9 @@ export function* untilState(state, pred) {
|
|
|
201
201
|
* and the fiber removed from the parent. See {@link Fiber.next} for details.
|
|
202
202
|
*
|
|
203
203
|
* @param promise
|
|
204
|
+
* @param opts
|
|
204
205
|
*/
|
|
205
|
-
export const untilPromise = (promise) => fiber(function* (ctx) {
|
|
206
|
+
export const untilPromise = (promise, opts) => fiber(function* (ctx) {
|
|
206
207
|
let error;
|
|
207
208
|
promise.then((x) => ctx.done(x), (e) => (error = e));
|
|
208
209
|
while (true) {
|
|
@@ -210,7 +211,7 @@ export const untilPromise = (promise) => fiber(function* (ctx) {
|
|
|
210
211
|
throw error;
|
|
211
212
|
yield;
|
|
212
213
|
}
|
|
213
|
-
});
|
|
214
|
+
}, opts);
|
|
214
215
|
/**
|
|
215
216
|
* Returns fiber which attaches a one-off event handler for event `type` to
|
|
216
217
|
* `target` and then "blocks" until the event occurred.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/fibers",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.5",
|
|
4
4
|
"description": "Process hierarchies & operators for cooperative multitasking",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@thi.ng/api": "^8.9.5",
|
|
38
|
-
"@thi.ng/arrays": "^2.6.
|
|
38
|
+
"@thi.ng/arrays": "^2.6.3",
|
|
39
39
|
"@thi.ng/bench": "^3.4.6",
|
|
40
40
|
"@thi.ng/checks": "^3.4.5",
|
|
41
41
|
"@thi.ng/errors": "^2.3.5",
|
|
@@ -108,5 +108,5 @@
|
|
|
108
108
|
"status": "alpha",
|
|
109
109
|
"year": 2023
|
|
110
110
|
},
|
|
111
|
-
"gitHead": "
|
|
111
|
+
"gitHead": "46e445c09f2909d1aeaa9fdc8d8b3aa61c114db2\n"
|
|
112
112
|
}
|