{"action":"created","issue":{"url":"https://api.github.com/repos/cujojs/most/issues/196","repository_url":"https://api.github.com/repos/cujojs/most","labels_url":"https://api.github.com/repos/cujojs/most/issues/196/labels{/name}","comments_url":"https://api.github.com/repos/cujojs/most/issues/196/comments","events_url":"https://api.github.com/repos/cujojs/most/issues/196/events","html_url":"https://github.com/cujojs/most/issues/196","id":134489504,"number":196,"title":"flatMapError() does not get called if stream explicitely end()'ed","user":{"login":"rielsi","id":2265222,"avatar_url":"https://avatars.githubusercontent.com/u/2265222?v=3","gravatar_id":"","url":"https://api.github.com/users/rielsi","html_url":"https://github.com/rielsi","followers_url":"https://api.github.com/users/rielsi/followers","following_url":"https://api.github.com/users/rielsi/following{/other_user}","gists_url":"https://api.github.com/users/rielsi/gists{/gist_id}","starred_url":"https://api.github.com/users/rielsi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rielsi/subscriptions","organizations_url":"https://api.github.com/users/rielsi/orgs","repos_url":"https://api.github.com/users/rielsi/repos","events_url":"https://api.github.com/users/rielsi/events{/privacy}","received_events_url":"https://api.github.com/users/rielsi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-02-18T05:59:54Z","updated_at":"2016-02-19T02:01:56Z","closed_at":null,"body":"If I `end()` created stream, `flatMapError()` doesn't get triggered:\r\n```\r\nmost\r\n    .create((add, end, error) => {\r\n        add()\r\n        end()      // notify subscribers they are free to unsubscribe\r\n    })\r\n    .tap(() => { throw new Error() })\r\n    .flatMapError(err => console.error(err))\r\n    .drain()\r\n```\r\nI do expect it to not swallow error. In the following case the error does get catched, though:\r\n```\r\nmost\r\n    .create((add, end, error) => {\r\n        add()\r\n    })\r\n    .take(1)       // signal to subscribers they may unsubscribe\r\n    .tap(() => { throw new Error() })\r\n    .flatMapError(err => console.error(err))\r\n    .drain()\r\n```\r\nHowever, in the latest case my main consideration is this: do subscribers unsubscribe when `take(x)` stream completely consumed?"},"comment":{"url":"https://api.github.com/repos/cujojs/most/issues/comments/186011032","html_url":"https://github.com/cujojs/most/issues/196#issuecomment-186011032","issue_url":"https://api.github.com/repos/cujojs/most/issues/196","id":186011032,"user":{"login":"briancavalier","id":90518,"avatar_url":"https://avatars.githubusercontent.com/u/90518?v=3","gravatar_id":"","url":"https://api.github.com/users/briancavalier","html_url":"https://github.com/briancavalier","followers_url":"https://api.github.com/users/briancavalier/followers","following_url":"https://api.github.com/users/briancavalier/following{/other_user}","gists_url":"https://api.github.com/users/briancavalier/gists{/gist_id}","starred_url":"https://api.github.com/users/briancavalier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/briancavalier/subscriptions","organizations_url":"https://api.github.com/users/briancavalier/orgs","repos_url":"https://api.github.com/users/briancavalier/repos","events_url":"https://api.github.com/users/briancavalier/events{/privacy}","received_events_url":"https://api.github.com/users/briancavalier/received_events","type":"User","site_admin":false},"created_at":"2016-02-19T02:01:56Z","updated_at":"2016-02-19T02:01:56Z","body":"@rielsi I found the issue.  There's a timing issue due to some of the async shenanigans that `create` does, and the fact that `create` is multicast by default.\r\n\r\nI'll think through a solution.\r\n\r\nOn a related note, can I ask what your use case for `create` is?"}}