__GetEvents

Introduction

Returns all event listeners of the Element in the form of an array.

Syntax

__GetEvents(element: Element) : Array<Record<string, any>>;

Parameters

Key Description
element Any Element object.

Return Value

Returns an array of all event listeners for the current Element, where each element in the array is a map that describes a single event listener.

Example

The frontend framework can retrieve the event listeners of an Element as follows.

// main-thread.js
let element = __CreateElement('view', 0, {});
__SetAttribute(element, 'src', 'xx');

__SetEvents(element, [{ type: 'bindEvent', name: 'tap', function: 'onTap' }]);

let listeners = __GetEvents(element);
Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.