bmorwood/chaos — pull request #3 by XpressiveCode (2014-03-13 22:35:27+00:00)
Title: Core - Updated Events

@bmorwood

all existing events are now updated to use the new pattern

I've also implemented a check on dispatch() that will automatically set the type if only a single event type has been registered to the event. Otherwise, if no event types or multiple event types are registered, it will throw a helpful error.

In the case of none, it states that. In the case of multiple, it will list out the available event types associated to the event.

In the case of a single event.. and you don't specify, it defaults and continues on. If you want we can make this explicit so they MUST always set a type instead of defaulting for them. I'm not sure which side of the fence I sit on that one.. One way promotes better code for new people taking over.. not understanding that the system affords them that flexibility.. the other rewards people that knows the system and allows for quicker development. So long as they follow the guidelines.

`Event.dispatch` has it all.