MCPcopy
hub / github.com/pythongosssss/ComfyUI-Custom-Scripts / fetch

Function fetch

web/js/common/binding.js:135–144  ·  view source on GitHub ↗

* @param {FetchCallback} cb

(cb, state)

Source from the content-addressed store, hash-verified

133 * @param {FetchCallback} cb
134 */
135 async fetch(cb, state) {
136 const url = cb.url.replace(/\{([^\}]+)\}/g, (m, v) => {
137 return PathHelper.get(state, v);
138 });
139 const res = await (await api.fetchApi(url)).json();
140 state["$result"] = res;
141 for (const m of cb.then) {
142 await invokeCallback(m, state);
143 }
144 },
145 /**
146 * @param {SetCallback} cb
147 */

Callers 5

sendToWorkflowFunction · 0.85
showMethod · 0.85
testUrlFunction · 0.85
getCivitaiDetailsMethod · 0.85
addCivitaiInfoMethod · 0.85

Calls 1

invokeCallbackFunction · 0.85

Tested by

no test coverage detected