Created
November 7, 2017 11:05
-
-
Save indatawetrust/0aeb922a5a70ce1464ca949f5dd69c20 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var interval = (func, bind, time) => { | |
this.interval = setInterval(func.bind(this, ...bind), time) | |
this.die = clearInterval.bind(null, this.interval) | |
} | |
interval(i => { | |
console.log(i) | |
this.die() | |
}, [1], 100) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment