MCPcopy Create free account
hub / github.com/chain/Core / tryCallback

Function tryCallback

sdk/node/src/shared.js:80–88  ·  view source on GitHub ↗
(promise, cb)

Source from the content-addressed store, hash-verified

78}
79
80const tryCallback = (promise, cb) => {
81 if (typeof cb !== 'function') return promise
82
83 return promise.then(value => {
84 setTimeout(() => cb(null, value), 0)
85 }, error => {
86 setTimeout(() => cb(error, null), 0)
87 })
88}
89
90const batchRequest = (client, path, params, cb) => {
91 return tryCallback(

Callers 2

batchRequestFunction · 0.85
shared.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected