UNPKG

@berish/rfp

Version:

Binary secure transport organization protocol for peer communication using function fingerprints

29 lines 1.05 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.disconnect = void 0; const stateful_1 = require("@berish/stateful"); function disconnect(store) { const scope = stateful_1.getScope(store); const privateScope = stateful_1.getPrivateScope(store); if (scope.isConnected) { if (privateScope.listenId) { scope.unlistenChange(privateScope.listenId); privateScope.listenId = undefined; } if (privateScope.unreceiveSetValue) { privateScope.unreceiveSetValue(); privateScope.unreceiveSetValue = undefined; } if (privateScope.unreceiveSetState) { privateScope.unreceiveSetState(); privateScope.unreceiveSetState = undefined; } if (privateScope.remoteChanges) { privateScope.remoteChanges = undefined; } scope.isConnected = false; scope.logger.info('disconnectedd'); } } exports.disconnect = disconnect; //# sourceMappingURL=disconnect.js.map