it-pushable
Advanced tools
Comparing version 1.3.0 to 1.3.1
@@ -10,2 +10,4 @@ const FIFO = require('fast-fifo') | ||
options = {} | ||
} else { | ||
onEnd = options.onEnd | ||
} | ||
@@ -12,0 +14,0 @@ |
{ | ||
"name": "it-pushable", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"description": "Pushable iterable", | ||
@@ -19,6 +19,6 @@ "main": "index.js", | ||
"devDependencies": { | ||
"ava": "^2.2.0", | ||
"ava": "^2.3.0", | ||
"it-pipe": "^1.0.1", | ||
"nyc": "^14.0.0", | ||
"standard": "^13.1.0" | ||
"nyc": "^14.1.1", | ||
"standard": "^14.1.0" | ||
}, | ||
@@ -25,0 +25,0 @@ "dependencies": { |
@@ -56,2 +56,6 @@ # it-pushable | ||
## Related | ||
* [`it-pipe`](https://www.npmjs.com/package/it-pipe) Utility to "pipe" async iterables together | ||
## Contribute | ||
@@ -58,0 +62,0 @@ |
10
test.js
@@ -115,2 +115,12 @@ import test from 'ava' | ||
test.cb('should call onEnd if passed in options object', t => { | ||
const source = pushable({ onEnd: () => t.end() }) | ||
const input = [1, 2, 3] | ||
for (let i = 0; i < input.length; i++) { | ||
setTimeout(() => source.push(input[i]), i * 10) | ||
} | ||
setTimeout(() => source.end(), input.length * 10) | ||
pipe(source, collect) | ||
}) | ||
test.cb('should call onEnd even if not piped', t => { | ||
@@ -117,0 +127,0 @@ const source = pushable(() => t.end()) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12888
324
67