UNPKG

rafa

Version:

Rafa.js is a Javascript framework for building concurrent applications.

20 lines (14 loc) 386 B
Implementation of an Enumerator. This calls the `read` method with the callback provided or throws an error if a callback is already registered. <aside> ```js // next(callback: A => _) var channel = Rafa.channel(); var stream = Rafa.stream(); var values = []; stream.enumerate(channel).each(v => values.push(v)); channel.write(1); channel.write(2); // values: [1,2]; ``` </aside>