MCPcopy Index your code
hub / github.com/easydiffusion/easydiffusion / applyFn

Function applyFn

ui/media/js/utils.js:399–411  ·  view source on GitHub ↗
(context, args)

Source from the content-addressed store, hash-verified

397 let timeout = null
398 let lastPromiseSrc = new PromiseSource()
399 const applyFn = function (context, args) {
400 let result = undefined
401 try {
402 result = func.apply(context, args)
403 } catch (err) {
404 lastPromiseSrc.reject(err)
405 }
406 if (result instanceof Promise) {
407 result.then(lastPromiseSrc.resolve, lastPromiseSrc.reject)
408 } else {
409 lastPromiseSrc.resolve(result)
410 }
411 }
412 return function (...args) {
413 const callNow = Boolean(immediate && !timeout)
414 const context = this

Callers 1

debounceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected