Hi Nick,

Some great techniques here!
1) nice use of revealing module pattern for public API -  though I
concur with Nicholas' recommendation to move to the bottom for clarity
2) nice minimalist use of curry
3) I like the way you farm everything through the reduce function

A couple of things:
1) Isn't there a danger of the async call in next() throwing an
infinite loop if things are running slow?
2) I'm wondering if there's any way to avoid copying the items at the
beginning of each reduce() call - might be an impact for larger
collections - perhaps you don't need to use shift to iterate?

nice work!
Angus


On Jan 7, 12:31 pm, Nick Fitzgerald <[email protected]> wrote:
> Hello everyone!
>
> Noodles 277 lines long, but with over 100 lines of comments I hope I'm not
> asking for too much when requesting code review :)
>
> Its pretty well known in the JS circle that if you are iterating over a
> really big list and doing a fairly expensive operation on each iteration,
> you can block the browser's UI thread and make it look like it froze for a
> few seconds. A common way to get around this (which is often easier than
> actually making your algorithms more performant) is to use some asynchronous
> version of `Array.prototype.forEach` so that the browser can have a moment
> to update the UI between every few iterations. This is what I mean by
> non-blocking.
>
> I thought it would be cool to have an async version for most of the HOFs on
> Array.prototype. Then I thought, well what if the operation on each
> iteration is asynchronous? And so I transformed it to use continuation
> passing style and callbacks.
>
> Right now, this is what is implemented: reduce, map, filter, forEach, every,
> and some. Everything is implemented in terms of reduce (other than reduce
> itself of course).
>
> I would love to get some feedback on this mini project!
>
> Thanks in advance to everyone!
>
> Project:https://github.com/fitzgen/noodles
>
> Main file:https://github.com/fitzgen/noodles/blob/master/noodles.js
>
> _Nick_

-- 
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/[email protected]/

To search via a non-Google archive, visit here: 
http://www.mail-archive.com/[email protected]/

To unsubscribe from this group, send email to
[email protected]

Reply via email to