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.

19 lines
411 B
JavaScript

"use strict";
const Promise = require("bluebird");
const pipe = require("@promistream/pipe");
const fromIterable = require("./");
const map = require("@promistream/map");
const collect = require("@promistream/collect");
Promise.try(() => {
return pipe([
fromIterable([ 1, 2, 3, 4 ]),
map((number) => number * 2),
collect()
]).read();
}).then((result) => {
console.log(result); // [ 2, 4, 6, 8 ]
});