New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

vue-pusher

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-pusher

Pusher plugin for vue.js

latest
Source
npmnpm
Version
1.1.0
Version published
Weekly downloads
1.9K
-18.57%
Maintainers
2
Weekly downloads
 
Created
Source

Vue Pusher

A pusher plugin for vue.js

Usage

Install the plugin like any other plugin. :)

var Vue = require('vue');

Vue.use(require('vue-pusher'), {
    api_key: 'xxxxxx',
    options: {
        cluster: 'ap1',
        encrypted: true,
    }
});

Manually using the pusher instance.

Inside your components, you just need to access the $pusher object.

export default {
    ready () {
        var channel = this.$pusher.subscribe('dashboard');

        channel.bind('user.log', ({ log }) => {
            console.log(`User ${log.user.name} has ${log.action} at ${log.time}`);
        });
    }
}

Subscribing to a channel.

Subscribing to a channel providers a callback where you can bind events.

this.$pusher.subscribe('dashboard', channel => {
    channel.bind('user.log', ({ log }) => {
        console.log(`User ${log.user.name} has ${log.action} at ${log.time}`);
    });
});

Unsubscribing to a channel.

this.$pusher.unsubscribe('dashboard');

Keywords

vuejs

FAQs

Package last updated on 21 Nov 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts