laravel-echo
Advanced tools
Comparing version 0.0.15 to 0.0.16
@@ -7,4 +7,8 @@ 'use strict'; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
@@ -54,6 +58,10 @@ | ||
value: function connect(pusherKey) { | ||
var customOptions = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; | ||
var _ref = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; | ||
var csrfToken = PusherConnector.csrfToken(); | ||
var csrfToken = _ref.csrfToken; | ||
var customOptions = _objectWithoutProperties(_ref, ['csrfToken']); | ||
var csrfToken = csrfToken || PusherConnector.csrfToken(); | ||
var pusher = new Pusher(pusherKey, PusherConnector.options(csrfToken, customOptions)); | ||
@@ -88,7 +96,3 @@ | ||
for (var attrname in customOptions) { | ||
options[attrname] = customOptions[attrname]; | ||
} | ||
return options; | ||
return _extends(options, customOptions); | ||
} | ||
@@ -95,0 +99,0 @@ |
{ | ||
"name": "laravel-echo", | ||
"version": "0.0.15", | ||
"version": "0.0.16", | ||
"description": "Laravel Echo library for beautiful Pusher integration", | ||
"main": "dist/echo.js", | ||
"scripts": { | ||
"compile": "babel --presets=es2015 -d dist/ src/", | ||
"compile": "babel -d dist/ src/", | ||
"prepublish": "npm run compile" | ||
@@ -25,4 +25,6 @@ }, | ||
"babel-cli": "^6.7.7", | ||
"babel-preset-es2015": "^6.6.0" | ||
"babel-plugin-transform-object-assign": "^6.8.0", | ||
"babel-preset-es2015": "^6.6.0", | ||
"babel-preset-stage-2": "^6.5.0" | ||
} | ||
} |
12419
6
291
4