disconnect

Closes the current connection to Kuzzle. The SDK then enters the offline state. A call to disconnect() will not trigger a disconnected event. This event is only triggered on unexpected disconnection.

If there are still pending requests during the disconnect call, a discarded event will be issued for each of them.

Arguments

Copied to clipboard!
disconnect();

Usage

Copied to clipboard!
try {
  kuzzle.disconnect();

  console.log('Successfully disconnected');
} catch (error) {
  console.error(error);
}