Observable

Observable

Empty class that has been mixed-in with Monologue which provide a destroy method that will
call off() on itself.

constructor()

Create a new instance.

destroy()

Remove any listener.

on(topic, callback): subscription

From Monologue.

off(topic)

From Monologue.

off()

From Monologue.

emit(topic, data)

From Monologue.

Source

index.js
import Monologue from 'monologue.js';

export default class Observable {
destroy() {
this.off();
}
}

// Add Observer pattern using Monologue.js
Monologue.mixInto(Observable);