, API:
most.from(['a', 'b', 'c', 'd'])
.scan(function(string, letter) {
return string + letter;
}, '')
.forEach(console.log.bind(console));
:
['a', 'b', 'c', 'd'] .scan().- ...
forEach().
. .
, most.js , 1340 ff.:
exports.from = from;
function from(a) {
if(Array.isArray(a) || isArrayLike(a)) {
return fromArray(a);
}
...
, from() fromArray(). fromArray() ( ) Stream:
...
function fromArray (a) {
return new Stream(new ArraySource(a));
}
...
, Stream sink.event(0, array[i]);, 0 . setTimeout, .event = function, , . , 4692 Scheduler delay() .
: , 0 .
, , - , . . , :-)?
. , :
https://jsfiddle.net/aak18y0m/1/
dispatch() . setTimeout():
setTimeout( function() { dispatch( 1 ); }, 0);
, , .
( ), . , :
doc ready
(index):61 Most loaded: [object Object]
(index):82 scanner state Object {foo: 0}
(index):75 scanner! 1
(index):82 scanner state Object {foo: 0}
(index):75 scanner! 2
(index):82 scanner state Object {foo: 0}
drain(), .
( ), dispatch() , , , JavaScript . // Alternative solution, .