You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
451 B
JavaScript

"use strict";
const Promise = require("bluebird");
const fromValue = require("./");
const pipe = require("@promistream/pipe");
const collect = require("@promistream/collect");
return Promise.try(() => {
return pipe([
fromValue(42),
collect()
]).read();
}).then((result) => {
console.log(result); // [ 42 ]
return pipe([
fromValue(Promise.resolve(9001)),
collect()
]).read();
}).then((result) => {
console.log(result); // [ 9001 ]
});