{"action":"created","issue":{"url":"https://api.github.com/repos/build-boiler/making-gulp-suck-less/issues/4","repository_url":"https://api.github.com/repos/build-boiler/making-gulp-suck-less","labels_url":"https://api.github.com/repos/build-boiler/making-gulp-suck-less/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/build-boiler/making-gulp-suck-less/issues/4/comments","events_url":"https://api.github.com/repos/build-boiler/making-gulp-suck-less/issues/4/events","html_url":"https://github.com/build-boiler/making-gulp-suck-less/pull/4","id":174849100,"number":4,"title":"Tentatively using some @flow","user":{"login":"awallace","id":6100,"avatar_url":"https://avatars.githubusercontent.com/u/6100?v=3","gravatar_id":"","url":"https://api.github.com/users/awallace","html_url":"https://github.com/awallace","followers_url":"https://api.github.com/users/awallace/followers","following_url":"https://api.github.com/users/awallace/following{/other_user}","gists_url":"https://api.github.com/users/awallace/gists{/gist_id}","starred_url":"https://api.github.com/users/awallace/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awallace/subscriptions","organizations_url":"https://api.github.com/users/awallace/orgs","repos_url":"https://api.github.com/users/awallace/repos","events_url":"https://api.github.com/users/awallace/events{/privacy}","received_events_url":"https://api.github.com/users/awallace/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-02T21:14:22Z","updated_at":"2016-09-03T19:49:12Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/build-boiler/making-gulp-suck-less/pulls/4","html_url":"https://github.com/build-boiler/making-gulp-suck-less/pull/4","diff_url":"https://github.com/build-boiler/making-gulp-suck-less/pull/4.diff","patch_url":"https://github.com/build-boiler/making-gulp-suck-less/pull/4.patch"},"body":"This adds @flow usage to TaskHandler, the Flow task, and a new types\r\nfile which might eventually encapsulate some commonly used types within\r\nthe build system.\r\n\r\nSome random notes:\r\n  * I really doubt build/tasks is the appropriate place for it\r\n  * I commented about this, but the Flow class now needs to null-check\r\n    utils and addbase, because by default they could be empty (according\r\n    to the current definition, since TaskHandler can default both\r\n    objects to be empty). In a happier world, they'd all get some\r\n    trusted defaults and some optional values, and flow would enforce.\r\n  * I added TaskManager.prototype.task() because it's being invoked from\r\n    run(), but not defined on the top prototype.\r\n  * I removed TaskManager.prototype.on() because it seemed pretty\r\n    redundant and flow decided that it wasn't compatible with\r\n    EventEmitter. This might be related to a bug [1] that got fixed a\r\n    few weeks ago, or it might be because EventEmitter.prototype.on is\r\n    actually assigned to EventEmitter.prototype.addListener, which flow\r\n    might consider somewhat untrustworthy. My guess is it's the bug.\r\n  * No semi colons is crazy town!\r\n\r\n[1] https://github.com/facebook/flow/commit/b11bbbc3441b5860e99d7eb6504b6197f14caa7d"},"comment":{"url":"https://api.github.com/repos/build-boiler/making-gulp-suck-less/issues/comments/244566386","html_url":"https://github.com/build-boiler/making-gulp-suck-less/pull/4#issuecomment-244566386","issue_url":"https://api.github.com/repos/build-boiler/making-gulp-suck-less/issues/4","id":244566386,"user":{"login":"awallace","id":6100,"avatar_url":"https://avatars.githubusercontent.com/u/6100?v=3","gravatar_id":"","url":"https://api.github.com/users/awallace","html_url":"https://github.com/awallace","followers_url":"https://api.github.com/users/awallace/followers","following_url":"https://api.github.com/users/awallace/following{/other_user}","gists_url":"https://api.github.com/users/awallace/gists{/gist_id}","starred_url":"https://api.github.com/users/awallace/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awallace/subscriptions","organizations_url":"https://api.github.com/users/awallace/orgs","repos_url":"https://api.github.com/users/awallace/repos","events_url":"https://api.github.com/users/awallace/events{/privacy}","received_events_url":"https://api.github.com/users/awallace/received_events","type":"User","site_admin":false},"created_at":"2016-09-03T19:49:12Z","updated_at":"2016-09-03T19:49:12Z","body":"Yeah, there's a better way of organizing it all with declarations/modules... although global types feels weird. I'll take a pass at implementing it since it seems to be the new hotness.\r\n\r\nThe interaction between `.on` and `.emit` within `constructor` seems pretty edge-casey, though. I had a similar snafu once and I cleaned it up by adding optional callbacks `initListeners` and `initSettings` within my top-level constructor, so that execution order of the 2 concepts was solid, and it offered me a bit more flexibility within child classes. So the order of operation for this would be:\r\n\r\n1. ChildClass.constructor() is invoked\r\n2. invokes super(), goes to ParentClass.constructor()\r\n3. invokes super(), goes to TaskHandler.constructor()\r\n4. `TaskHandler.constructor()` calls `this.initListeners()` and `this.initEmittances` (or a better name), which can then just go back up the chain from child > parent, and use `super()` if needed, and it's all pretty easy to follow & avoids timing issues with `super()`\r\n\r\nAnyways this is well off-topic, but that's how I'd skin that particular cat. :)"}}
{"actor":{"display_login":"awallace"}}