MCPcopy Create free account
hub / github.com/SuperMap/iClient-JavaScript / unregister

Method unregister

src/common/commontypes/Events.js:321–334  ·  view source on GitHub ↗

* @function Events.prototype.unregister * @description 取消注册。 * @param {string} type - 事件类型。 * @param {Object} [obj=this.object] - 对象绑定的回调。 * @param {function} [func] - 回调函数,如果没有特定的回调,则这个函数不做任何事情。

(type, obj, func)

Source from the content-addressed store, hash-verified

319 * @param {function} [func] - 回调函数,如果没有特定的回调,则这个函数不做任何事情。
320 */
321 unregister(type, obj, func) {
322 if (obj == null) {
323 obj = this.object;
324 }
325 var listeners = this.listeners[type];
326 if (listeners != null) {
327 for (var i = 0, len = listeners.length; i < len; i++) {
328 if (listeners[i].obj === obj && listeners[i].func === func) {
329 listeners.splice(i, 1);
330 break;
331 }
332 }
333 }
334 }
335
336
337 /**

Callers 1

unMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected