rstyle-sequential-promise-map

1.0.1 • Public • Published

When.js Vs Ramda

Something unfortunate happened to me over the weekend... I was writing code using the great Ramda and there was promises going on and the code was wonderful... And then came along then awesome When.js to solve my future based problems. I love when.js but writing this:

return when.map(
    R.map(getUserIds, sittings)
    whenGuard(whenGuard.n(1), getUsers)
).then(processUser);

Was enough to make me cry. It's not that I don't love both of these tools but the fact that Ramda takes it's arguments in the proper way R.map(mapping_function, what_to_map_over) because it does currying but when.js does the more normal when.map(what_to_map_over, mapping_function)... horrible!

So I'm sold on Ramda now, it's a lot nicer to work with than other libraries though I do appreciate them existing because at least they have made some people think in some new ways than they used to. But this flip flopping of parameter types in my code has to be stopped in my code now.

While thinking about this I realised that I was using when.all, when.map (always with a guard of 1) and the promise funcationality. So Promise.all I already have if I switch to Node v0.11 or polyfill it later so all I need to do is hack up a sequential promise mapper and I'll have a much lighter set of code...

So I did, you can get it at GitHub or via npm.

Readme

Keywords

Package Sidebar

Install

npm i rstyle-sequential-promise-map

Weekly Downloads

0

Version

1.0.1

License

MIT

Last publish

Collaborators

  • forbesmyster