This API is deprecated and will be turned down in January 2019. Migrate to Cloud Firestore or another data store as soon as possible to avoid disruptions to your application.

Class: EventTarget

Methods
addEventListener(type, listener[, opt_capture]) void

Adds an event listener to the event target. The same handler can only be added once per the type. Even if you add the same handler multiple times using the same type then it will only be called once when the event is dispatched.

removeAllEventListeners() void

Removes all event listeners from this object.

removeEventListener(type, listener[, opt_capture]) void

Removes an event listener from the event target. The handler must be the same object as the one added. If the handler has not been added then nothing is done.

new EventTarget()

Methods

addEventListener(type, listener[, opt_capture])

Adds an event listener to the event target. The same handler can only be added once per the type. Even if you add the same handler multiple times using the same type then it will only be called once when the event is dispatched.

Parameters

Name Type Optional Description

type

string

 

The type of the event to listen for.

listener

(non-null function() or non-null EventListener)

 

The function to handle the event. The handler can also be an object that implements the handleEvent method which takes the event object as argument.

opt_capture

boolean

Yes

Whether to handle the event target in the capture phase instead of the bubble phase.

removeAllEventListeners()

Removes all event listeners from this object.

removeEventListener(type, listener[, opt_capture])

Removes an event listener from the event target. The handler must be the same object as the one added. If the handler has not been added then nothing is done.

Parameters

Name Type Optional Description

type

gapi.drive.realtime.EventType

 

The type of the event to listen for.

listener

(non-null function() or non-null EventListener)

 

The function to or EventListener to remove.

opt_capture

boolean

Yes

Whether to handle the event target in the capture phase instead of the bubble phase.

Send feedback about...

Realtime API
Realtime API