Skip to content

cy.removeAllListeners()

cy.removeAllListeners — Core > Events. Cytoscape.js signatures, parameters and return contract.

cy.removeAllListeners — Core › Events

Preview · Core › Events

Read in the complete API reference · All API members

// Remove all listeners
cy.removeAllListeners(): this

Remove every listener on the core, including element-bound and delegated ones.

Returns this

this core, for chaining

Example

let calls = 0;
cy.on('example', () => calls++);
cy.removeAllListeners();
cy.emit('example');
console.log(calls); // 0

Example graph and handle setup