Skip to content

eles.promiseOn(events)

eles.promiseOn — Collection > Events. Cytoscape.js signatures, parameters and return contract.

eles.promiseOn — Collection › Events

Preview · Collection › Events

Read in the complete API reference · All API members

// Resolve once the next matching event fires on any element of this collection — the promise form of one()
eles.promiseOn(events: string): Promise<Event<NodeData, EdgeData>>

Resolve once the next matching event fires on any element of this collection — the promise form of one().

Parameters
NameDescription
events: string

one or more space-separated event names

Returns Promise<Event<NodeData, EdgeData>>

a promise for the event object

Example

const next = cy.getElementById('a').promiseOn('example');
cy.getElementById('a').emit('example');
console.log((await next).type); // 'example'

Example graph and handle setup

Also spelled eles.pon.