laravel-echo
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -95,4 +95,4 @@ var classCallCheck = function (instance, Constructor) { | ||
var selector = document.querySelector('meta[name="csrf-token"]'); | ||
if (window.Laravel && window.Laravel.csrfToken) { | ||
return window.Laravel.csrfToken; | ||
if (window['Laravel'] && window['Laravel'].csrfToken) { | ||
return window['Laravel'].csrfToken; | ||
} else if (this.options.csrfToken) { | ||
@@ -152,3 +152,3 @@ return this.options.csrfToken; | ||
function PusherChannel(channel, connector) { | ||
function PusherChannel(channel, options) { | ||
classCallCheck(this, PusherChannel); | ||
@@ -159,6 +159,6 @@ | ||
_this.channel = channel; | ||
_this.connector = connector; | ||
_this.options = options; | ||
_this.eventFormatter = new EventFormatter(); | ||
if (_this.connector.options.namespace) { | ||
_this.eventFormatter.namespace(_this.connector.options.namespace); | ||
if (_this.options.namespace) { | ||
_this.eventFormatter.namespace(_this.options.namespace); | ||
} | ||
@@ -230,3 +230,3 @@ return _this; | ||
function SocketIoChannel(channel, connector) { | ||
function SocketIoChannel(channel, options) { | ||
classCallCheck(this, SocketIoChannel); | ||
@@ -237,6 +237,6 @@ | ||
_this.channel = channel; | ||
_this.connector = connector; | ||
_this.options = options; | ||
_this.eventFormatter = new EventFormatter(); | ||
if (_this.connector.options.namespace) { | ||
_this.eventFormatter.namespace(_this.connector.options.namespace); | ||
if (_this.options.namespace) { | ||
_this.eventFormatter.namespace(_this.options.namespace); | ||
} | ||
@@ -336,3 +336,3 @@ return _this; | ||
value: function channel(_channel) { | ||
return new PusherChannel(this.createChannel(_channel), this); | ||
return new PusherChannel(this.createChannel(_channel), this.options); | ||
} | ||
@@ -342,3 +342,3 @@ }, { | ||
value: function privateChannel(channel) { | ||
return new PusherChannel(this.createChannel('private-' + channel), this); | ||
return new PusherChannel(this.createChannel('private-' + channel), this.options); | ||
} | ||
@@ -348,3 +348,3 @@ }, { | ||
value: function presenceChannel(channel) { | ||
return new PusherPresenceChannel(this.createChannel('presence-' + channel), this); | ||
return new PusherPresenceChannel(this.createChannel('presence-' + channel), this.options); | ||
} | ||
@@ -423,3 +423,3 @@ }, { | ||
value: function channel(_channel) { | ||
return new SocketIoChannel(this.createChannel(_channel), this); | ||
return new SocketIoChannel(this.createChannel(_channel), this.options); | ||
} | ||
@@ -429,3 +429,3 @@ }, { | ||
value: function privateChannel(channel) { | ||
return new SocketIoChannel(this.createChannel('private-' + channel), this); | ||
return new SocketIoChannel(this.createChannel('private-' + channel), this.options); | ||
} | ||
@@ -435,3 +435,3 @@ }, { | ||
value: function presenceChannel(channel) { | ||
return new SocketIoPresenceChannel(this.createChannel('presence-' + channel), this); | ||
return new SocketIoPresenceChannel(this.createChannel('presence-' + channel), this.options); | ||
} | ||
@@ -489,8 +489,8 @@ }, { | ||
this.options = options; | ||
if (Vue && Vue.http) { | ||
if (typeof Vue === 'function' && Vue.http) { | ||
this.registerVueRequestInterceptor(); | ||
} | ||
if (this.options.broadcaster == 'pusher') { | ||
if (!window.Pusher) { | ||
window.Pusher = require('pusher-js'); | ||
if (!window['Pusher']) { | ||
window['Pusher'] = require('pusher-js'); | ||
} | ||
@@ -497,0 +497,0 @@ this.connector = new PusherConnector(this.options); |
{ | ||
"name": "laravel-echo", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "Laravel Echo library for beautiful Pusher integration", | ||
@@ -5,0 +5,0 @@ "main": "dist/echo.js", |
/// <reference path="globals/node/index.d.ts" /> | ||
declare let Pusher: any; | ||
declare let io: any; | ||
declare let Vue: any; |
122233
2771