stephen-moyer / ngx-signalr-hubservice

Makes using SignalR in Angular 2/4 easy
MIT License
24 stars 5 forks source link

I wanted to add query string to the hub connection. Couldnt found a way out? #5

Closed nik0405 closed 6 years ago

nik0405 commented 6 years ago

I wanted something equivalent to [$.connection.hub.qs] which we set up while using jQuery.

Please Help!!

stephen-moyer commented 6 years ago

Yes, I can implement this feature. Should have it done by the end of the week.

nik0405 commented 6 years ago

Hi , did you try doing it?

I tried , but on first loginof my application if successfully works , but on refresh of page i am not able to send back the query string again , though the connection is trying to reconnect.

async connection() { if (!this.connected) { this.connected = await this.hubService.connect(this.url).toPromise();//environment.signalRURL this.hubService.connection.qs = { 'ClientId': this._auth.getUser().SystemUserId }; this.hubWrapper = this.hubService.register(this); } }

When i refresh my application , the qs goes as null!! Please help.

stephen-moyer commented 6 years ago

Sorry. Christmas time is busy for me. I will try to get to this some time this week.

nik0405 commented 6 years ago

Thanks for the response , but i figured out a way . i modified your library with an extra parameter in initConnection() method.

Thanks!!

stephen-moyer commented 6 years ago

If you are interested, I added a qs parameter to the connect method on HubService. This is in version 1.1.5.