node package manager
Orgs are free. Discover, share, and reuse code in your team. Create a free org ยป

abe-utils

abe-utils

A collection of reusable class I'm going to use in my own projects

Mediator/Party

A simple version of the mediator design pattern. The mediator mediates messages between Parties.

Example

class Controller extends Party {
  ...

  tellUser () {
    this.broadcast('MESSAGE_SENT', { message: 'Hello, world!' });
  }

  ...
}

class View extends Party {
  constructor () {
    this.on('MESSAGE_SENT', alert(message));
  }

  ...
}