__GetEvent

Introduction

Returns the event listener specific to the Element.

Syntax

__GetEvent(element: Element, name: string, type: string) : string|Function|undefined;

Parameters

Key Description
element Any Element object.
name A case-sensitive string representing the event name.
type A case-sensitive string representing the event type.

Return Value

Returns the event listener for the current Element with the specified name.

Example

The frontend framework can retrieve the event listener 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 listener = __GetEvent(element, 'tap', 'bindEvent');
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.