MCPcopy Create free account
hub / github.com/esengine/esengine / clear

Method clear

packages/fairygui/src/core/Timer.ts:199–213  ·  view source on GitHub ↗

* Clear a specific callback * 清除指定回调 * * @param caller Callback context | 回调上下文 * @param callback Callback function | 回调函数

(caller: any, callback: Function)

Source from the content-addressed store, hash-verified

197 * @param callback Callback function | 回调函数
198 */
199 public clear(caller: any, callback: Function): void {
200 for (const cb of this._callbacks.values()) {
201 if (cb.caller === caller && cb.callback === callback) {
202 cb.removed = true;
203 }
204 }
205
206 this._callLaterList = this._callLaterList.filter(
207 (item) => !(item.caller === caller && item.callback === callback)
208 );
209
210 this._callLaterPending = this._callLaterPending.filter(
211 (item) => !(item.caller === caller && item.callback === callback)
212 );
213 }
214
215 /**
216 * Clear all callbacks for a caller

Callers 1

addCallbackMethod · 0.95

Calls 2

filterMethod · 0.65
valuesMethod · 0.45

Tested by

no test coverage detected