src/wampy.js
/**
     * RPC unregistration for invocation
     * @param {string} topicURI
     * @param {function|object} callbacks - if it is a function, it will be called on successful unregistration
     *                          or it can be hash table of callbacks:
     *                          { onSuccess: will be called on successful unregistration
     *                            onError: will be called if unregistration would be aborted }
     * @returns {Wampy}
     */
RPC unregistration for invocation
@param {string} topicURI
@param {function|object} callbacks - if it is a function, it will be called on successful unregistration
or it can be hash table of callbacks:
{ onSuccess: will be called on successful unregistration
onError: will be called if unregistration would be aborted }
@returns {Wampy}
RPC unregistration for invocation @param { string } topicURI @param { function|object } callbacks - if it is a function it will be called on successful unregistration or it can be hash table of callbacks : { onSuccess : will be called on successful unregistration onError : will be called if unregistration would be aborted } @returns { Wampy }
unregister (topicURI, callbacks) {
        let reqId;
        if (!this._preReqChecks({ topic: topicURI, patternBased: false, allowWAMP: false }, 'dealer', callbacks)) {
            return this;
        }
        if (typeof callbacks === 'function') {
            callbacks = { onSuccess: callbacks };
        }
        if (this._rpcRegs[topicURI]) {   
            reqId = this._getReqId();
            this._requests[reqId] = {
                topic: topicURI,
                callbacks
            };
            this._send([WAMP_MSG_SPEC.UNREGISTER, reqId, this._rpcRegs[topicURI].id]);
            this._cache.opStatus = WAMP_ERROR_MSG.SUCCESS;
            this._cache.opStatus.reqId = reqId;
        } else {    
            this._cache.opStatus = WAMP_ERROR_MSG.NON_EXIST_RPC_UNREG;
            if (this._isPlainObject(callbacks) && callbacks.onError) {
                callbacks.onError({ error: this._cache.opStatus.description });
            }
        }
        return this;
    }
unregister ( topicURI , callbacks ) { let reqId ; if ( ! this . _preReqChecks ( { topic : topicURI , patternBased : false , allowWAMP : false } , 'dealer' , callbacks ) ) { return this ; } if ( typeof callbacks === 'function' ) { callbacks = { onSuccess : callbacks } ; } if ( this . _rpcRegs [ topicURI ] ) { reqId = this . _getReqId ( ) ; this . _requests [ reqId ] = { topic : topicURI , callbacks } ; this . _send ( [ WAMP_MSG_SPEC . UNREGISTER , reqId , this . _rpcRegs [ topicURI ] . id ] ) ; this . _cache . opStatus = WAMP_ERROR_MSG . SUCCESS ; this . _cache . opStatus . reqId = reqId ; } else { this . _cache . opStatus = WAMP_ERROR_MSG . NON_EXIST_RPC_UNREG ; if ( this . _isPlainObject ( callbacks ) && callbacks . onError ) { callbacks . onError ( { error : this . _cache . opStatus . description } ) ; } } return this ; }
RPC unregistration for invocation
 @param {string} topicURI
 @param {function|object} callbacks - if it is a function, it will be called on successful unregistration
                          or it can be hash table of callbacks:
                          { onSuccess: will be called on successful unregistration
                            onError: will be called if unregistration would be aborted }
 @returns {Wampy}
RPC unregistration for invocation @param { string } topicURI @param { function|object } callbacks - if it is a function it will be called on successful unregistration or it can be hash table of callbacks : { onSuccess : will be called on successful unregistration onError : will be called if unregistration would be aborted } @returns { Wampy }
// there is such registration // WAMP SPEC: [UNREGISTER, Request|id, REGISTERED.Registration|id] // there is no registration with such topicURI