1.0.8 • Published 4 years ago

pusher-vue v1.0.8

Weekly downloads
12
License
MIT
Repository
github
Last release
4 years ago

PusherVue

Pusher for Vue.js, highly inspired by ActionCableVue

일단 개인적으로 사용하려고 만듬.

Getting Started

npm install pusher-vue --save
import Vue from 'vue';
import PusherVue from 'pusher-vue';
import App from './App.vue';

Vue.use(PusherVue, {
  appKey: 'your-app-key',
  cluster: 'pusher-app-cluster',
  debug: true,
  debugLevel: 'all'
});

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app');

Component Level Usage

new Vue({
  data() {
    return {
      message: 'Hello world'
    };
  },
  channels: {
    ChatChannel: {
      subscribeOnMount: true,
      subscribed() {
        console.log('subscribed ChatChannel');
      },
      unsubscribed() {
        console.log('unsubscribed ChatChannel');
      },
      bind: {
        message(rawData) {
          const data = JSON.parse(rawData);
          const message = data.message;

          this.message = data.message;
          console.log(`received message '${message}' from ChatChannel on event 'message'`);
        }
      }
    }
  }
});

TODO

  • TypeScript 테스트
1.0.8

4 years ago

1.0.7

4 years ago

1.0.4

4 years ago

1.0.2

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago