@fbltd/async 1.0.12 → 1.0.14
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
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Async tools
|
|
2
2
|
|
|
3
|
+
## Disclaimer
|
|
4
|
+
Now this package is CommonJS module but should be an ESM.
|
|
5
|
+
|
|
6
|
+
## Installation
|
|
7
|
+
You can install this package with your favorite package manager.<br/>
|
|
8
|
+
Npm, for example, will be looks like:
|
|
9
|
+
```npm i @fbltd/async```
|
|
10
|
+
|
|
3
11
|
## Overview
|
|
4
12
|
|
|
5
13
|
### delay
|
|
@@ -99,10 +107,4 @@ export const Counter: React.FC<ITest> = React.memo(({
|
|
|
99
107
|
</div>
|
|
100
108
|
)
|
|
101
109
|
})
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
### Disclaimer
|
|
105
|
-
Now this package is CommonJS module but should be an ESM.
|
|
106
|
-
|
|
107
|
-
## Installation
|
|
108
|
-
Just type ```npm i @fbltd/async```
|
|
110
|
+
```
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InternalStreamFinishError = void 0;
|
|
3
4
|
exports.next = next;
|
|
4
5
|
const constants_1 = require("../../constants");
|
|
6
|
+
const StreamFinishError = new Error("Stream is done");
|
|
5
7
|
async function next(dep) {
|
|
6
|
-
|
|
8
|
+
const res = await dep[constants_1.symAI]().next();
|
|
9
|
+
if (res.done) {
|
|
10
|
+
throw StreamFinishError;
|
|
11
|
+
}
|
|
12
|
+
return res.value;
|
|
7
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
exports.InternalStreamFinishError = StreamFinishError;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { DependencyStream } from "../dependency-stream";
|
|
2
|
-
export declare function next<T>(dep: DependencyStream<T>): Promise<
|
|
2
|
+
export declare function next<T>(dep: DependencyStream<T>): Promise<T>;
|
package/package.json
CHANGED