stream(methodName, ...args) {
        const [streams, streamIds] = this._replaceStreamingParams(args);
        const invocationDescriptor = this._createStreamInvocation(methodName, args, streamIds);
        // eslint-disable-next-line prefer-const
        let promiseQueue;
        const subject = new _Subject__WEBPACK_IMPORTED_MODULE_4__.Subject();
        subject.cancelCallback = () => {
            const cancelInvocation = this._createCancelInvocation(invocationDescriptor.invocationId);
            delete this._callbacks[invocationDescriptor.invocationId];
            return promiseQueue.then(() => {
                return this._sendWithProtocol(cancelInvocation);
            });
        };
        this._callbacks[invocationDescriptor.invocationId] = (invocationEvent, error) => {
            if (error) {
                subject.error(error);
                return;
            }
            else if (invocationEvent) {
                // invocationEvent will not be null when an error is not passed to the callback
                if (invocationEvent.type === _IHubProtocol__WEBPACK_IMPORTED_MODULE_3__.MessageType.Completion) {
                    if (invocationEvent.error) {
                        subject.error(new Error(invocationEvent.error));
                    }
                    else {
                        subject.complete();
                    }
                }
                else {
                    subject.next((invocationEvent.item));
                }
            }
        };
        promiseQueue = this._sendWithProtocol(invocationDescriptor)
            .catch((e) => {
            subject.error(e);
            delete this._callbacks[invocationDescriptor.invocationId];
        });
        this._launchStreams(streams, promiseQueue);
        return subject;
    }
/** Invokes a streaming hub method on the server using the specified name and arguments.
     *
     * @typeparam T The type of the items returned by the server.
     * @param {string} methodName The name of the server method to invoke.
     * @param {any[]} args The arguments used to invoke the server method.
     * @returns {IStreamResult<T>} An object that yields results from the server as they are received.
     */
Invokes a streaming hub method on the server using the specified name and arguments.
@typeparam T The type of the items returned by the server.
@param {string} methodName The name of the server method to invoke.
@param {any[]} args The arguments used to invoke the server method.
@returns {IStreamResult} An object that yields results from the server as they are received.
Invokes a streaming hub method on the server using the specified name and arguments . @typeparam T The type of the items returned by the server . @param { string } methodName The name of the server method to invoke . @param { any [] } args The arguments used to invoke the server method . @returns { IStreamResult } An object that yields results from the server as they are received .
stream(methodName, ...args) {
        const [streams, streamIds] = this._replaceStreamingParams(args);
        const invocationDescriptor = this._createStreamInvocation(methodName, args, streamIds);
        let promiseQueue;
        const subject = new _Subject__WEBPACK_IMPORTED_MODULE_4__.Subject();
        subject.cancelCallback = () => {
            const cancelInvocation = this._createCancelInvocation(invocationDescriptor.invocationId);
            delete this._callbacks[invocationDescriptor.invocationId];
            return promiseQueue.then(() => {
                return this._sendWithProtocol(cancelInvocation);
            });
        };
        this._callbacks[invocationDescriptor.invocationId] = (invocationEvent, error) => {
            if (error) {
                subject.error(error);
                return;
            }
            else if (invocationEvent) {
                if (invocationEvent.type === _IHubProtocol__WEBPACK_IMPORTED_MODULE_3__.MessageType.Completion) {
                    if (invocationEvent.error) {
                        subject.error(new Error(invocationEvent.error));
                    }
                    else {
                        subject.complete();
                    }
                }
                else {
                    subject.next((invocationEvent.item));
                }
            }
        };
        promiseQueue = this._sendWithProtocol(invocationDescriptor)
            .catch((e) => {
            subject.error(e);
            delete this._callbacks[invocationDescriptor.invocationId];
        });
        this._launchStreams(streams, promiseQueue);
        return subject;
    }
stream ( methodName , ... args ) { const [ streams , streamIds ] = this . _replaceStreamingParams ( args ) ; const invocationDescriptor = this . _createStreamInvocation ( methodName , args , streamIds ) ; let promiseQueue ; const subject = new _Subject__WEBPACK_IMPORTED_MODULE_4__ . Subject ( ) ; subject . cancelCallback = ( ) => { const cancelInvocation = this . _createCancelInvocation ( invocationDescriptor . invocationId ) ; delete this . _callbacks [ invocationDescriptor . invocationId ] ; return promiseQueue . then ( ( ) => { return this . _sendWithProtocol ( cancelInvocation ) ; } ) ; } ; this . _callbacks [ invocationDescriptor . invocationId ] = ( invocationEvent , error ) => { if ( error ) { subject . error ( error ) ; return ; } else if ( invocationEvent ) { if ( invocationEvent . type === _IHubProtocol__WEBPACK_IMPORTED_MODULE_3__ . MessageType . Completion ) { if ( invocationEvent . error ) { subject . error ( new Error ( invocationEvent . error ) ) ; } else { subject . complete ( ) ; } } else { subject . next ( ( invocationEvent . item ) ) ; } } } ; promiseQueue = this . _sendWithProtocol ( invocationDescriptor ) . catch ( ( e ) => { subject . error ( e ) ; delete this . _callbacks [ invocationDescriptor . invocationId ] ; } ) ; this . _launchStreams ( streams , promiseQueue ) ; return subject ; }
Invokes a streaming hub method on the server using the specified name and arguments.
Invokes a streaming hub method on the server using the specified name and arguments .
// eslint-disable-next-line prefer-const // invocationEvent will not be null when an error is not passed to the callback