Object wrapper for setTimeout function
It can be very useful if you're writing web applications using React.js.
let objTimeout = require('obj-timeout');
let App = React.createClass({
waiter: null,
componentDidMount: function() {
this.waiter = new objTimeout(() => {
console.log('waited')
}, 2000);
},
componentWillUnmount: function() {
this.waiter.destroy()
},
...
});