integration_moodle/src/utils.js
Julien Veyssier a5e3fc7298
almost there
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
2020-09-02 19:57:18 +02:00

11 lines
235 B
JavaScript

let mytimer = 0
export function delay(callback, ms) {
return function() {
const context = this
const args = arguments
clearTimeout(mytimer)
mytimer = setTimeout(function() {
callback.apply(context, args)
}, ms || 0)
}
}