Skip to content

Mixin for listening to Event Emitters from React components

Notifications You must be signed in to change notification settings

jjjjw/EEObserverMixin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Observer

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]
});

About

Mixin for listening to Event Emitters from React components

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published