0.0.1 • Published 9 years ago
ee-observer-mixin v0.0.1
Official sound effects (see Livefyre/Observer).
The EEObserverMixin adds a .listenTo
method to a React component. Events that are subscribed to using this method will have their handlers automatically unsubscribed when the component unmounts.
Usage
npm install ee-observer-mixin
var EEObserverMixin = require('ee-observer-mixin');
var React = require('react');
React.createClass({
componentDidMount: function () {
this.listenTo(eventEmitter, 'eventName', callback);
},
mixins: [EEObserverMixin]
});