React mixin for listenable componentWillUnmount
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dist
npm-react-unmount-listener-mixin
README.md
package.json

README.md

react-unmount-listener-mixin

React mixin for listenable componentWillMount. 729 bytes uncompressed, 381 bytes compressed.

React.createClass({
  mixins: [ReactUnmountListenerMixin],

  componentDidMount: function() {
    // perform request, abort on componentWillUnmount
    this.addUnmountListener(abortRequestFunction);
  },
  handleClickAbort: function() {
    // abort request, stop listening to componentWillUnmount
    this.removeUnmountListener(abortRequestFunction);
  },
  ...
});

Download

Script (minified) (source)

<script src="react-unmount-listener-mixin.js"></script>

AMD (minified) (source)

define(['react-unmount-listener-mixin'], function(ReactUnmountListenerMixin) {
});

CommonJS (minified) (source)

var ReactUnmountListenerMixin = require('react-unmount-listener-mixin');

CommonJS via package manager

npm install --save react-unmount-listener-mixin
bower install --save react-unmount-listener-mixin