laravel-echo
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -76,3 +76,3 @@ var classCallCheck = function (instance, Constructor) { | ||
key: null, | ||
namespace: '' | ||
namespace: 'App.Events' | ||
}; | ||
@@ -124,6 +124,6 @@ this.setOptions(options); | ||
var EventFormatter = function () { | ||
function EventFormatter() { | ||
function EventFormatter(namespace) { | ||
classCallCheck(this, EventFormatter); | ||
this.defaultNamespace = 'App.Events'; | ||
this.setNamespace(namespace); | ||
} | ||
@@ -134,5 +134,5 @@ | ||
value: function format(event) { | ||
if (this.defaultNamespace !== false) { | ||
if (this.namespace) { | ||
if (event.charAt(0) != '\\' && event.charAt(0) != '.') { | ||
event = this.defaultNamespace + '.' + event; | ||
event = this.namespace + '.' + event; | ||
} else { | ||
@@ -145,5 +145,5 @@ event = event.substr(1); | ||
}, { | ||
key: 'namespace', | ||
value: function namespace(value) { | ||
this.defaultNamespace = value; | ||
key: 'setNamespace', | ||
value: function setNamespace(value) { | ||
this.namespace = value; | ||
} | ||
@@ -165,6 +165,3 @@ }]); | ||
_this.options = options; | ||
_this.eventFormatter = new EventFormatter(); | ||
if (_this.options.namespace) { | ||
_this.eventFormatter.namespace(_this.options.namespace); | ||
} | ||
_this.eventFormatter = new EventFormatter(_this.options.namespace); | ||
_this.subscribe(); | ||
@@ -250,6 +247,3 @@ return _this; | ||
_this.options = options; | ||
_this.eventFormatter = new EventFormatter(); | ||
if (_this.options.namespace) { | ||
_this.eventFormatter.namespace(_this.options.namespace); | ||
} | ||
_this.eventFormatter = new EventFormatter(_this.options.namespace); | ||
_this.subscribe(); | ||
@@ -256,0 +250,0 @@ return _this; |
{ | ||
"name": "laravel-echo", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Laravel Echo library for beautiful Pusher integration", | ||
@@ -5,0 +5,0 @@ "main": "dist/echo.js", |
123163
2794