rul

react-unmount-listener-mixin

React mixin for listenable componentWillUnmount

Showing:

Popularity

Downloads/wk

2

GitHub Stars

4

Maintenance

Last Commit

7yrs ago

Contributors

0

Package

Dependencies

0

Size (min+gzip)

0.4KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

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

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100