This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const lscache = require('lscache') | |
// This is your plugin object. It can be exported to be used anywhere. | |
const MyPlugin = { | |
// The install method is all that needs to exist on the plugin object. | |
// It takes the global Vue object as well as user-defined options. | |
install (Vue, options) { | |
// We add $ls for lscache | |
Vue.prototype.$ls = { | |
get: lscache.get, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var WebSocketServer = require('uws').Server; | |
var wss = new WebSocketServer({ port: 3000 }); | |
var Redis = require('ioredis'); | |
var redis = new Redis('localhost', 6379); | |
var pub = new Redis('localhost', 6379); | |
redis.subscribe('msg', function (err, count) { | |
// Now we are subscribed to the 'msg' channel. | |
// `count` represents the number of channels we are currently subscribed to. |
NewerOlder