app/js/patchwork/core/Patch.js
/**
         * Removes a given connection from the patch.
         * @param connectionToRemove
         */
Removes a given connection from the patch.
Removes a given connection from the patch .
removeConnection(connectionToRemove) {
            let index = this.connections.indexOf(connectionToRemove);
            if (index >= 0) {
                this.dispatchEvent(PatchEvent_1.default.CONNECTION_PRE_REMOVE, { connection: connectionToRemove });
                this.connections.splice(index, 1);
                this.dispatchEvent(PatchEvent_1.default.CONNECTION_POST_REMOVE, { connection: connectionToRemove });
                connectionToRemove.destruct();
            }
            else {
                console.error('Connection not found', connectionToRemove);
            }
        }
removeConnection ( connectionToRemove ) { let index = this . connections . indexOf ( connectionToRemove ) ; if ( index >= 0 ) { this . dispatchEvent ( PatchEvent_1 . default . CONNECTION_PRE_REMOVE , { connection : connectionToRemove } ) ; this . connections . splice ( index , 1 ) ; this . dispatchEvent ( PatchEvent_1 . default . CONNECTION_POST_REMOVE , { connection : connectionToRemove } ) ; connectionToRemove . destruct ( ) ; } else { console . error ( 'Connection not found' , connectionToRemove ) ; } }
Removes a given connection from the patch.
Removes a given connection from the patch .
// dispatch event *before* removing, so the ACM can still figure out what connections are involved // editor redraws from post event