# @latelier/vue-signalr

> Signalr client for vue js

Latest version **2.0.4** (published 2020-07-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install @latelier/vue-signalr
pnpm add @latelier/vue-signalr
yarn add @latelier/vue-signalr
bun add @latelier/vue-signalr
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.4 |
| Published | 2020-07-20 |
| First published | 2018-05-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 18.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 48 |
| Author | L'Atelier |
| Maintainers | dragon_, loicmay, mikatux |
| Keywords | vue, vuejs, signalr |

## Links

- npm: https://www.npmjs.com/package/@latelier/vue-signalr
- Repository: https://github.com/latelierco/vue-signalr
- Homepage: https://github.com/latelierco/vue-signalr#readme
- Issues: https://github.com/latelierco/vue-signalr/issues
- npm.io page: https://npm.io/package/@latelier/vue-signalr

## Dependencies (2)

- [tslib](https://npm.io/package/tslib.md) ^2.0.0
- [@microsoft/signalr](https://npm.io/package/@microsoft/signalr.md) ^3.1.5

## Recent versions

- 2.0.4 (latest) — 2020-07-20
- 2.0.3 — 2020-07-10
- 2.0.2 — 2020-07-10
- 2.0.1 — 2020-07-09
- 2.0.0 — 2020-07-08
- 1.1.9 — 2019-06-10
- 1.1.8 — 2019-06-10
- 1.1.7 — 2019-06-10
- 1.1.6 — 2019-05-29
- 1.1.5 — 2019-05-29
- 1.1.4 — 2019-05-29
- 1.1.3 — 2019-05-29
- 1.1.2 — 2019-05-27
- 1.1.1 — 2019-05-27
- 1.1.0 — 2019-05-27
- … 7 more at https://npm.io/package/@latelier/vue-signalr/versions

## README

# vue-signalr


## Installation


```console
$ npm install @latelier/vue-signalr --save
```

## Get started


```js
import Vue from 'vue'
import VueSignalR from 'vue-signalr'

Vue.use(VueSignalR, 'SOCKET_URL');

new Vue({
  el: '#app',
  render: h => h(App),
  
  created() {
    this.$socket.start({
      log: false // Active only in development for debugging.
    });
  },

});
```

## Example with component

```js
Vue.extend({

  ...
  
  methods: {
  
    someMethod() {
      this.$socket.invoke('socketName', payloadData)
        .then(response => {
          ...
        })
    }
    
    async someAsyncMethod() {
      const response = await this.$socket.invoke('socketName', payloadData)
      ...
    }
    
  },

  // Register your listener here. 
  sockets: {
  
    // Equivalent of
    // signalrHubConnection.on('someEvent', (data) => this.someActionWithData(data))
    someEvent(data) {
      this.someActionWithData(data)
    }
    
    otherSomeEvent(data) {
      this.otheSomeActionWithOtherSomeData(data)
    }
    
  }

});


```

---
_Source: https://npm.io/package/@latelier/vue-signalr · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
