學習節點流管理器highland.js的繩索。highland.js:地圖功能不按預期工作
試圖這樣做非常基本的東西:
_ = require("highland")
doubled = (x)->
return x*2
_.map(doubled, [1, 2, 3, 4])
,並沒有得到輸出
,當我去運行
_ = require("highland")
doubled = (x)->
return x*2
console.log(_.map(doubled, [1, 2, 3, 4]))
我得到以下輸出:
{ domain: null,
_events: { newListener: [Function], removeListener: [Function] },
_maxListeners: 10,
id: '200471',
paused: true,
_incoming: [],
_outgoing: [],
_consumers: [],
_observers: [],
_send_events: false,
_send: [Function],
source:
{ domain: null,
_events: { newListener: [Function], removeListener: [Function] },
_maxListeners: 10,
id: '060326',
paused: true,
_incoming: [ 1, 2, 3, 4, {} ],
_outgoing: [],
_consumers: [ [Circular] ],
_observers: [],
_send_events: false } }
WHI ch在我看來就像一個沒有任何內容的流。
我在這裏做錯了什麼?