{"action":"created","issue":{"url":"https://api.github.com/repos/mynameisdaniil/yaff/issues/3","labels_url":"https://api.github.com/repos/mynameisdaniil/yaff/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/mynameisdaniil/yaff/issues/3/comments","events_url":"https://api.github.com/repos/mynameisdaniil/yaff/issues/3/events","html_url":"https://github.com/mynameisdaniil/yaff/issues/3","id":65046421,"number":3,"title":"Parallel tasks call \"finally\" function multiple times  (a call for every error)","user":{"login":"triadium","id":11703916,"avatar_url":"https://avatars.githubusercontent.com/u/11703916?v=3","gravatar_id":"","url":"https://api.github.com/users/triadium","html_url":"https://github.com/triadium","followers_url":"https://api.github.com/users/triadium/followers","following_url":"https://api.github.com/users/triadium/following{/other_user}","gists_url":"https://api.github.com/users/triadium/gists{/gist_id}","starred_url":"https://api.github.com/users/triadium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/triadium/subscriptions","organizations_url":"https://api.github.com/users/triadium/orgs","repos_url":"https://api.github.com/users/triadium/repos","events_url":"https://api.github.com/users/triadium/events{/privacy}","received_events_url":"https://api.github.com/users/triadium/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"mynameisdaniil","id":685003,"avatar_url":"https://avatars.githubusercontent.com/u/685003?v=3","gravatar_id":"","url":"https://api.github.com/users/mynameisdaniil","html_url":"https://github.com/mynameisdaniil","followers_url":"https://api.github.com/users/mynameisdaniil/followers","following_url":"https://api.github.com/users/mynameisdaniil/following{/other_user}","gists_url":"https://api.github.com/users/mynameisdaniil/gists{/gist_id}","starred_url":"https://api.github.com/users/mynameisdaniil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mynameisdaniil/subscriptions","organizations_url":"https://api.github.com/users/mynameisdaniil/orgs","repos_url":"https://api.github.com/users/mynameisdaniil/repos","events_url":"https://api.github.com/users/mynameisdaniil/events{/privacy}","received_events_url":"https://api.github.com/users/mynameisdaniil/received_events","type":"User","site_admin":false},"milestone":null,"comments":5,"created_at":"2015-03-29T10:26:12Z","updated_at":"2015-03-30T19:28:44Z","closed_at":null,"body":"Parallel tasks call **finally** function multiple times (a call for every error), but callback already done for a first error - app state changed.\r\nI think better to call **finally** function with an array of errors. For a **seq** function set an \"one-item\" array of errors, for a **par** function put error to its position of calling. And **null** unless no errors."},"comment":{"url":"https://api.github.com/repos/mynameisdaniil/yaff/issues/comments/87799854","html_url":"https://github.com/mynameisdaniil/yaff/issues/3#issuecomment-87799854","issue_url":"https://api.github.com/repos/mynameisdaniil/yaff/issues/3","id":87799854,"user":{"login":"mynameisdaniil","id":685003,"avatar_url":"https://avatars.githubusercontent.com/u/685003?v=3","gravatar_id":"","url":"https://api.github.com/users/mynameisdaniil","html_url":"https://github.com/mynameisdaniil","followers_url":"https://api.github.com/users/mynameisdaniil/followers","following_url":"https://api.github.com/users/mynameisdaniil/following{/other_user}","gists_url":"https://api.github.com/users/mynameisdaniil/gists{/gist_id}","starred_url":"https://api.github.com/users/mynameisdaniil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mynameisdaniil/subscriptions","organizations_url":"https://api.github.com/users/mynameisdaniil/orgs","repos_url":"https://api.github.com/users/mynameisdaniil/repos","events_url":"https://api.github.com/users/mynameisdaniil/events{/privacy}","received_events_url":"https://api.github.com/users/mynameisdaniil/received_events","type":"User","site_admin":false},"created_at":"2015-03-30T19:28:44Z","updated_at":"2015-03-30T19:28:44Z","body":"I think it will work like `unflatten()` e.g.\r\n```javascript\r\nvar myAsyncFun = function (images, cb) {\r\n  YAFF(images)\r\n    .parMap(...) //will return array of all errors into cb\r\n    .unfaltten()\r\n    .seq(...) //will return single error\r\n    .collectAll()\r\n    .finally(cb)\r\n};\r\n\r\nIn case of errors in `parMap(...)` it will return array of errors into cb, in case of error in `seq(..)` it will return single error. But let's see how everything will turn out. I'm working on implementation right now.\r\n\r\n```"}}