Skip to content

Instantly share code, notes, and snippets.

@EdJ
Created January 23, 2014 16:02
Show Gist options
  • Save EdJ/2eed46430a9d184c0fef to your computer and use it in GitHub Desktop.
Save EdJ/2eed46430a9d184c0fef to your computer and use it in GitHub Desktop.
Short example of something I'm a bit confused about in the current implementation of Asynquence's map() implementation.
var ASQ = require('asynquence');
require('asynquence-contrib');
var returnsArr = function returnsArr(c) { c && c([1]); return [1]};
ASQ().map(returnsArr(), function (v, c) { c(v + 1) }); // fine
ASQ().then(returnsArr).map(function (v, c) { c(v + 1) }); // doesn't work
@getify
Copy link

getify commented Jan 24, 2014

After thinking it over, I decided to update map(..) itself to handle this use-case. Was a simple addition and there was no need for a separate plugin.

Thanks for the idea! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment