Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Sync apply function
syncApply ({timeout, fn, args = [], scope = this}) {
return new Promise((resolve, reject) => {
try {
setTimeout(() => {
resolve(fn.apply(scope, args))
}, timeout)
} catch (err) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.