Implement EmitterMixin

Issue #1 resolved
Kenneth Jorgensen
repo owner created an issue

Attaches an instance-local event bus to the object, allowing other objects to listen for events generated by that specific instance only. Attached methods:

  • on() - Adds a listener just like subscribe().
  • off() - Adds a listener just like unsubscribe().
  • _trigger() - Sends an event to the bus.

Can be attached using calamity.emitter(TypeName.prototype).

This functionality is very similar to what is provided by for instance Backbone.Events.

Comments (2)

  1. Log in to comment