MCPcopy Index your code
hub / github.com/SuperMap/iClient-JavaScript / one

Method one

src/common/overlay/levelRenderer/Eventful.js:55–73  ·  view source on GitHub ↗

* @function LevelRenderer.Eventful.prototype.one * @description 单次触发绑定,dispatch后销毁。 * @param {string} event - 事件名。 * @param {boolean} handler - 响应函数。 * @param {Object} context - context。 * @returns {LevelRenderer.Eventful} this

(event, handler, context)

Source from the content-addressed store, hash-verified

53 * @returns {LevelRenderer.Eventful} this
54 */
55 one(event, handler, context) {
56 var _h = this._handlers;
57
58 if (!handler || !event) {
59 return this;
60 }
61
62 if (!_h[event]) {
63 _h[event] = [];
64 }
65
66 _h[event].push({
67 h: handler,
68 one: true,
69 ctx: context || this
70 });
71
72 return this;
73 }
74
75
76 /**

Callers 3

addMethod · 0.80
onAddMethod · 0.80
jquery.jsFile · 0.80

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected