actioncable-vue
Advanced tools
Comparing version 2.4.0 to 2.4.1
{ | ||
"name": "actioncable-vue", | ||
"version": "2.4.0", | ||
"version": "2.4.1", | ||
"description": "A Vue plugin that makes integrating ActionCable easy.", | ||
@@ -5,0 +5,0 @@ "main": "dist/actioncablevue.js", |
@@ -23,2 +23,3 @@ <p align="center"> | ||
```javascript | ||
// Vue 2.x | ||
import Vue from 'vue'; | ||
@@ -42,2 +43,22 @@ import ActionCableVue from 'actioncable-vue'; | ||
```javascript | ||
// Vue 3.x | ||
import { createApp } from 'vue'; | ||
import App from './App.vue'; | ||
import ActionCableVue from 'actioncable-vue'; | ||
const actionCableVueOptions = { | ||
debug: true, | ||
debugLevel: 'error', | ||
connectionUrl: 'ws://localhost:5000/api/cable', | ||
connectImmediately: true | ||
}; | ||
createApp(App) | ||
.use(store) | ||
.use(router) | ||
.use(ActionCableVue, actionCableVueOptions) | ||
.mount('#app'); | ||
``` | ||
| **Parameters** | **Type** | **Default** | **Required** | **Description** | | ||
@@ -44,0 +65,0 @@ | ------------------ | -------- | ----------- | ------------ | ---------------------------------------------------------------------------------------------------------- | |
@@ -9,3 +9,3 @@ import Vue from "vue"; | ||
subscribe: (subscription: string | ChannelNameWithParams, name?: string) => void; | ||
perform: ({channel: string, action: string, data: {}}) | ||
perform: (whatToDo: {channel: string, action: string, data: object}) => void; | ||
unsubscribe: (channelName: string) => void; | ||
@@ -12,0 +12,0 @@ connected: boolean; |
33769
425