{"action":"created","issue":{"url":"https://api.github.com/repos/geejs/gulp-tap/issues/18","repository_url":"https://api.github.com/repos/geejs/gulp-tap","labels_url":"https://api.github.com/repos/geejs/gulp-tap/issues/18/labels{/name}","comments_url":"https://api.github.com/repos/geejs/gulp-tap/issues/18/comments","events_url":"https://api.github.com/repos/geejs/gulp-tap/issues/18/events","html_url":"https://github.com/geejs/gulp-tap/issues/18","id":249892113,"number":18,"title":"Async onEnd doesn't run when called after tap","user":{"login":"flekschas","id":932103,"avatar_url":"https://avatars1.githubusercontent.com/u/932103?v=4","gravatar_id":"","url":"https://api.github.com/users/flekschas","html_url":"https://github.com/flekschas","followers_url":"https://api.github.com/users/flekschas/followers","following_url":"https://api.github.com/users/flekschas/following{/other_user}","gists_url":"https://api.github.com/users/flekschas/gists{/gist_id}","starred_url":"https://api.github.com/users/flekschas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flekschas/subscriptions","organizations_url":"https://api.github.com/users/flekschas/orgs","repos_url":"https://api.github.com/users/flekschas/repos","events_url":"https://api.github.com/users/flekschas/events{/privacy}","received_events_url":"https://api.github.com/users/flekschas/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-08-13T18:59:01Z","updated_at":"2018-03-20T15:06:18Z","closed_at":null,"author_association":"NONE","body":"When I specify `.on('end', callback)` after calling `tap` the event callback will not be fired. One can get around this by specifying the event callback first but I am wondering if this is expected or a bug?\r\n\r\n```javascript\r\ngulp.task('test', function() {\r\n    return gulp.src(paths.css)\r\n        .pipe(doSomething())\r\n        .on('end', tap(function() {\r\n            // this will be executed\r\n            console.log('Tasks done (A)')\r\n        }))\r\n        .pipe(tap(function(file) {\r\n            console.log(file);\r\n        }))\r\n        .on('end', tap(function() {\r\n            // this will not be executed\r\n            console.log('Tasks done (B)')\r\n        }))\r\n});\r\n```"},"comment":{"url":"https://api.github.com/repos/geejs/gulp-tap/issues/comments/374632317","html_url":"https://github.com/geejs/gulp-tap/issues/18#issuecomment-374632317","issue_url":"https://api.github.com/repos/geejs/gulp-tap/issues/18","id":374632317,"user":{"login":"Kagami","id":533383,"avatar_url":"https://avatars1.githubusercontent.com/u/533383?v=4","gravatar_id":"","url":"https://api.github.com/users/Kagami","html_url":"https://github.com/Kagami","followers_url":"https://api.github.com/users/Kagami/followers","following_url":"https://api.github.com/users/Kagami/following{/other_user}","gists_url":"https://api.github.com/users/Kagami/gists{/gist_id}","starred_url":"https://api.github.com/users/Kagami/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kagami/subscriptions","organizations_url":"https://api.github.com/users/Kagami/orgs","repos_url":"https://api.github.com/users/Kagami/repos","events_url":"https://api.github.com/users/Kagami/events{/privacy}","received_events_url":"https://api.github.com/users/Kagami/received_events","type":"User","site_admin":false},"created_at":"2018-03-20T15:06:18Z","updated_at":"2018-03-20T15:06:18Z","author_association":"NONE","body":"It works for me with simple\r\n\r\n```js\r\ngulp.task('test', () =>\r\n  gulp.src(…).pipe(…).on('end')\r\n)\r\n```\r\n\r\nbut not with \r\n\r\n```js\r\ngulp.task('test', (cb) =>\r\n  gulp.src(…).pipe(…).on('end', cb)\r\n)\r\n```"}}
{"actor":{"display_login":"Kagami"}}