react-unmount-listener-mixin
v1.0.2
Published
React mixin for listenable componentWillUnmount
Downloads
4
Maintainers
Readme
react-unmount-listener-mixin
React mixin for listenable componentWillMount. 729 bytes uncompressed, 381 bytes compressed.
var ReactUnmountListenerMixin = require('react-unmount-listener-mixin');
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);
},
...
});