{"action":"closed","issue":{"url":"https://api.github.com/repos/pandastrike/fairmont/issues/22","labels_url":"https://api.github.com/repos/pandastrike/fairmont/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/pandastrike/fairmont/issues/22/comments","events_url":"https://api.github.com/repos/pandastrike/fairmont/issues/22/events","html_url":"https://github.com/pandastrike/fairmont/issues/22","id":60038353,"number":22,"title":"Ignoring Rejected Promises","user":{"login":"PandaPup","id":6767448,"avatar_url":"https://avatars.githubusercontent.com/u/6767448?v=3","gravatar_id":"","url":"https://api.github.com/users/PandaPup","html_url":"https://github.com/PandaPup","followers_url":"https://api.github.com/users/PandaPup/followers","following_url":"https://api.github.com/users/PandaPup/following{/other_user}","gists_url":"https://api.github.com/users/PandaPup/gists{/gist_id}","starred_url":"https://api.github.com/users/PandaPup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PandaPup/subscriptions","organizations_url":"https://api.github.com/users/PandaPup/orgs","repos_url":"https://api.github.com/users/PandaPup/repos","events_url":"https://api.github.com/users/PandaPup/events{/privacy}","received_events_url":"https://api.github.com/users/PandaPup/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-03-06T00:10:29Z","updated_at":"2015-03-18T02:51:59Z","closed_at":"2015-03-18T02:51:59Z","body":"Hey @dyoder, I have another proposal.  Sometimes we don't care if a promise is rejected, we just need to wait for it to be done one way or another.  I propose a function that accepts an input promise, p, but always resolves \"true\".\r\n\r\nI had a specific and legitimate use-case when I wrote the original version, but I was unsure about abstracting it to submit this to you for Fairmont.  \r\n1.  On one hand, it can be handy to have a function that grants a kind of idempotence to an arbitrary function, but\r\n2. This is a dangerous function because you end up losing state and errors could be hard to catch.  \r\n\r\nI try to be mindful of Crockford's advice to avoid dangerous styles, so please know I don't submit this lightly.  I'd understand if you have misgivings and I'd really like your opinion.  \r\n\r\n**source**\r\n```coffee\r\nforce = (p, args...) ->\r\n  {partial} = require \"./core\"\r\n  {promise} = require \"when\"\r\n\r\n  # Compose the promise that was passed in.\r\n  p = partial p, args...\r\n\r\n  # Evaluate the promise to achieve its side effects, but always resolve true.\r\n  promise (resolve, reject) ->\r\n    p.catch resolve true\r\n    call -> yield p()\r\n    resolve true\r\n```\r\n\r\n**example**\r\n```coffee\r\n# The affected function is passed into \"force\", with its arguments following it instead of being passed directly. \r\ncall ->\r\n  # This one fails out if the alias is not present.\r\n  yield shell \"git remote rm  #{argv[0]}\"\r\n\r\n  # This one will quietly continue to the next line.\r\n  yield force shell, \"git remote rm  #{argv[0]}\"\r\n```"}}