2.0.4 • Published 5 years ago
@latelier/vue-signalr v2.0.4
vue-signalr
Installation
$ npm install @latelier/vue-signalr --save
Get started
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
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)
}
}
});
2.0.4
5 years ago
2.0.3
5 years ago
2.0.2
5 years ago
2.0.1
5 years ago
2.0.0
5 years ago
1.1.9
6 years ago
1.1.8
6 years ago
1.1.7
6 years ago
1.1.6
6 years ago
1.1.5
6 years ago
1.1.4
6 years ago
1.1.3
6 years ago
1.1.2
6 years ago
1.1.1
6 years ago
1.1.0
6 years ago
1.0.3
6 years ago
1.0.2
6 years ago
1.0.1
6 years ago
1.0.0
7 years ago
0.0.3
7 years ago
0.0.2
7 years ago
0.0.1
7 years ago