0.0.6 • Published 3 years ago

generic-signalr-service v0.0.6

Weekly downloads
-
License
-
Repository
github
Last release
3 years ago

Dependency

This library was created by Angular version 15

Install

npm install generic-signalr-service

npm i @microsoft/signalr

Use

You have to call SignalRService in your constructor

Example

constructor(private _signalR: SignalRService){
    this._signalR.start("http://localhost:7014/message-hub", ()=> callBack());
}

callBack(){
    //methods.
}

Methods

This service have two methods.

invoke

invoke(procedureName: string, successCallBack?: (value: any) => void, errorCallBack?: (error: any) => void) {
    this.connection.invoke(procedureName)
      .then(successCallBack)
      .catch(errorCallBack)
  }

on

  on(procedureName: string, callBack: (...message: any) => void) {
    this.connection.on(procedureName, callBack)
  }
0.0.5

3 years ago

0.0.6

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago