ot

obj-timeout

npm i obj-timeout

Readme

obj-timeout

Object wrapper for setTimeout function

Why

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()
    },
    ...
});

Jump To

obj-timeout
Why