mirror of
https://github.com/nextcloud/integration_moodle.git
synced 2025-12-17 21:02:05 +01:00
11 lines
235 B
JavaScript
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)
|
|
}
|
|
}
|