Skip to content
master
Switch branches/tags
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 

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

About

React mixin for listenable componentWillUnmount

Resources

Packages

No packages published