MCPcopy Create free account
hub / github.com/NativeScript/NativeScript / once

Method once

packages/core/data/observable/index.ts:182–184  ·  view source on GitHub ↗

* Adds a listener for the specified event name, which, once fired, will * remove itself. * * @param eventName The name of the event. * @param callback The event listener to add. Will be called when an event of * the given name is raised. * @param thisArg An optional parameter which, when

(eventName: string, callback: (data: EventData) => void, thisArg?: any)

Source from the content-addressed store, hash-verified

180 * bound.
181 */
182 public once(eventName: string, callback: (data: EventData) => void, thisArg?: any): void {
183 this.addEventListener(eventName, callback, thisArg, true);
184 }
185
186 /**
187 * Removes the listener(s) for the specified event name.

Calls 1

addEventListenerMethod · 0.95

Tested by 1

handler1Function · 0.64