KustomerCore.removeListener()

Removes a callback function that was added through addListener()

👍

First, initialize chat

You must run KustomerCore.init() before you can execute any additional KustomerCore methods.

Examples

We're provided some examples of how you can call KustomerCore.removeListener():

const onMessageReceivedHandler = function () {
  console.log('Message was received');
};

KustomerCore.addListener('onMessageReceived', onMessageReceivedHandler);

KustomerCore.removeListener('onMessageReceived', onMessageReceivedHandler);

Syntax

KustomerCore.removeListener(event, function)

📘

Is that really you?

When you use removeListener, make sure that the function you pass in is the same reference as the one you used when you ran addListener or it won't be removed properly.