Conversation
@@ -4,3 +4,4 @@ | |||
/vendor/ | |||
/examples/build.js | |||
.tern-port | |||
.npm-degub.log |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should it be "debug"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doh!!
Not entirely sure I understand the use case, but the code looks right! 👍 |
var events = eventName.split(':'); | ||
while(events.length){ | ||
var currentEvent = events.join(':'); | ||
var listeners = this._listeners[currentEvent] || Immutable.Set(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this is quite right, I think the scope of this statement (due to the initialisation) is outside the while loop? We don't want the listeners to vary during the execution right?
@cutandpastey Excuse my ignorance but why do you want the sub-events fired? If I pass in 'scribe:content-changed' why would I want to fire an event called 'scribe'? In my mind this was more that the Scribe EventEmitter would add a namespace to the events being fired if one wasn't provided. So if I sent 'hello' to the Scribe EventEmitter then it would emerge as 'scribe:hello' |
Good work on getting unit-testing working, it's going to make things much easier in future 👏 |
So in noting I want to fire something like |
@cutandpastey Okay I understand so this is actually like a fountain event rather than namespacing? |
👍 |
👍 with some wiki documentation and a green build! |
Is it me or is it impossible to re-run a travis build without pushing a commit? |
@cutandpastey You should see a refresh button on your "Job" status page you need to have logged in via your Github account to get the permissions though |
@rrees let me know if this is all good: https://github.com/guardian/scribe/wiki/Components Now its time to mash that Travis button |
@cutandpastey Looks good |
Adding namespacing to events will allow us to cleanup some of the state management in noting.