Class: EventSource

Oracle® JavaScript Extension Toolkit (JET)
7.1.0

F18183-01

QuickNav


EventSource

Version:
  • 7.1.0
Since:
  • 1.1
Module:
  • ojcore-base

Module usage

See JET Module Loading for an overview of module usage within JET.

Typescript Import Format
//To import this class, use the format below.
import {EventSource} from "ojs/ojcore-base";

JET In Typescript

A detailed description of working with JET elements and classes in your typescript project can be found at: JET Typescript Usage.

Description

Object which supports subscribing to and firing events
Deprecated:
Since Description
5.0.0 Use DataProvider instead.

Constructor

new EventSource()

Deprecated:
Since Description
5.0.0 Use DataProvider instead.

Methods

handleEvent(eventType, event) → {boolean}

Handle the event
Parameters:
Name Type Description
eventType string event type
event Object event
Returns:
Returns false if event is cancelled
Type
boolean

Init()

Initializes the instance.

off(eventType, eventHandler) → {void}

Detach an event handler.

Application can call this if it no longer wants to be notified of an event that it has attached an handler to using the on method.

Parameters:
Name Type Description
eventType string eventType
eventHandler function(Object) event handler function
Returns:
Type
void

on(eventType, eventHandler) → {void}

Attach an event handler.

Application can call this if it wants to be notified of an event. It can call the off method to detach the handler when it no longer wants to be notified.

Parameters:
Name Type Description
eventType string eventType
eventHandler function(Object) event handler function
Returns:
Type
void