MCPcopy Create free account
hub / github.com/alibaba/lowcode-engine / onGot

Method onGot

packages/editor-core/src/config.ts:311–320  ·  view source on GitHub ↗

* 获取指定 key 的值,函数回调模式,若多次被赋值,回调会被多次调用 * @param key * @param fn * @returns

(key: string, fn: (data: any) => void)

Source from the content-addressed store, hash-verified

309 * @returns
310 */
311 onGot(key: string, fn: (data: any) => void): () => void {
312 const val = this.config?.[key];
313 if (val !== undefined) {
314 fn(val);
315 }
316 this.setWait(key, fn);
317 return () => {
318 this.delWait(key, fn);
319 };
320 }
321
322 notifyGot(key: string): void {
323 let waits = this.waits.get(key);

Callers

nothing calls this directly

Calls 2

setWaitMethod · 0.95
delWaitMethod · 0.95

Tested by

no test coverage detected