laravel-echo
Advanced tools
Comparing version 1.3.5 to 1.4.0
140
dist/echo.js
@@ -523,2 +523,84 @@ var asyncGenerator = function () { | ||
var NullChannel = function (_Channel) { | ||
inherits(NullChannel, _Channel); | ||
function NullChannel() { | ||
classCallCheck(this, NullChannel); | ||
return possibleConstructorReturn(this, (NullChannel.__proto__ || Object.getPrototypeOf(NullChannel)).apply(this, arguments)); | ||
} | ||
createClass(NullChannel, [{ | ||
key: 'subscribe', | ||
value: function subscribe() {} | ||
}, { | ||
key: 'unsubscribe', | ||
value: function unsubscribe() {} | ||
}, { | ||
key: 'listen', | ||
value: function listen(event, callback) { | ||
return this; | ||
} | ||
}, { | ||
key: 'stopListening', | ||
value: function stopListening(event) { | ||
return this; | ||
} | ||
}, { | ||
key: 'on', | ||
value: function on(event, callback) { | ||
return this; | ||
} | ||
}]); | ||
return NullChannel; | ||
}(Channel); | ||
var NullPrivateChannel = function (_NullChannel) { | ||
inherits(NullPrivateChannel, _NullChannel); | ||
function NullPrivateChannel() { | ||
classCallCheck(this, NullPrivateChannel); | ||
return possibleConstructorReturn(this, (NullPrivateChannel.__proto__ || Object.getPrototypeOf(NullPrivateChannel)).apply(this, arguments)); | ||
} | ||
createClass(NullPrivateChannel, [{ | ||
key: 'whisper', | ||
value: function whisper(eventName, data) { | ||
return this; | ||
} | ||
}]); | ||
return NullPrivateChannel; | ||
}(NullChannel); | ||
var NullPresenceChannel = function (_NullChannel) { | ||
inherits(NullPresenceChannel, _NullChannel); | ||
function NullPresenceChannel() { | ||
classCallCheck(this, NullPresenceChannel); | ||
return possibleConstructorReturn(this, (NullPresenceChannel.__proto__ || Object.getPrototypeOf(NullPresenceChannel)).apply(this, arguments)); | ||
} | ||
createClass(NullPresenceChannel, [{ | ||
key: 'here', | ||
value: function here(callback) { | ||
return this; | ||
} | ||
}, { | ||
key: 'joining', | ||
value: function joining(callback) { | ||
return this; | ||
} | ||
}, { | ||
key: 'leaving', | ||
value: function leaving(callback) { | ||
return this; | ||
} | ||
}, { | ||
key: 'whisper', | ||
value: function whisper(eventName, data) { | ||
return this; | ||
} | ||
}]); | ||
return NullPresenceChannel; | ||
}(NullChannel); | ||
var PusherConnector = function (_Connector) { | ||
@@ -695,2 +777,58 @@ inherits(PusherConnector, _Connector); | ||
var NullConnector = function (_Connector) { | ||
inherits(NullConnector, _Connector); | ||
function NullConnector() { | ||
var _ref; | ||
classCallCheck(this, NullConnector); | ||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
var _this = possibleConstructorReturn(this, (_ref = NullConnector.__proto__ || Object.getPrototypeOf(NullConnector)).call.apply(_ref, [this].concat(args))); | ||
_this.channels = {}; | ||
return _this; | ||
} | ||
createClass(NullConnector, [{ | ||
key: 'connect', | ||
value: function connect() {} | ||
}, { | ||
key: 'listen', | ||
value: function listen(name, event, callback) { | ||
return new NullChannel(); | ||
} | ||
}, { | ||
key: 'channel', | ||
value: function channel(name) { | ||
return new NullChannel(); | ||
} | ||
}, { | ||
key: 'privateChannel', | ||
value: function privateChannel(name) { | ||
return new NullPrivateChannel(); | ||
} | ||
}, { | ||
key: 'presenceChannel', | ||
value: function presenceChannel(name) { | ||
return new NullPresenceChannel(); | ||
} | ||
}, { | ||
key: 'leave', | ||
value: function leave(name) {} | ||
}, { | ||
key: 'socketId', | ||
value: function socketId() { | ||
return 'fake-socket-id'; | ||
} | ||
}, { | ||
key: 'disconnect', | ||
value: function disconnect() {} | ||
}]); | ||
return NullConnector; | ||
}(Connector); | ||
var Echo = function () { | ||
@@ -714,2 +852,4 @@ function Echo(options) { | ||
this.connector = new SocketIoConnector(this.options); | ||
} else if (this.options.broadcaster == 'null') { | ||
this.connector = new NullConnector(this.options); | ||
} | ||
@@ -716,0 +856,0 @@ } |
{ | ||
"name": "laravel-echo", | ||
"version": "1.3.5", | ||
"version": "1.4.0", | ||
"description": "Laravel Echo library for beautiful Pusher and Socket.IO integration", | ||
@@ -8,3 +8,4 @@ "main": "dist/echo.js", | ||
"compile": "./node_modules/.bin/rollup -c", | ||
"prepublish": "npm run compile" | ||
"prepublish": "npm run compile", | ||
"test": "jest" | ||
}, | ||
@@ -27,4 +28,4 @@ "repository": { | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"@types/jest": "^22.1.0", | ||
"@types/node": "^6.0.85", | ||
@@ -34,7 +35,23 @@ "babel-plugin-transform-object-assign": "^6.8.0", | ||
"babel-preset-stage-2": "^6.5.0", | ||
"jest": "^22.1.0", | ||
"pusher-js": "^3.2.1", | ||
"rollup-plugin-babel": "^2.4.0", | ||
"rollup-plugin-typescript": "^0.7.5", | ||
"rollup": "^0.31.0", | ||
"rollup-plugin-babel": "^2.4.0", | ||
"rollup-plugin-typescript": "^0.7.5" | ||
"ts-jest": "^22.0.0" | ||
}, | ||
"jest": { | ||
"transform": { | ||
"^.+\\.tsx?$": "ts-jest" | ||
}, | ||
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$", | ||
"moduleFileExtensions": [ | ||
"ts", | ||
"tsx", | ||
"js", | ||
"jsx", | ||
"json", | ||
"node" | ||
] | ||
} | ||
} |
@@ -37,3 +37,3 @@ /** | ||
* @param {Function} callback | ||
* @return {PusherChannel} | ||
* @return {Channel} | ||
*/ | ||
@@ -40,0 +40,0 @@ listenForWhisper(event: string, callback: Function): Channel { |
@@ -9,1 +9,4 @@ export * from './channel'; | ||
export * from './socketio-presence-channel'; | ||
export * from './null-channel'; | ||
export * from './null-private-channel'; | ||
export * from './null-presence-channel'; |
export * from './connector'; | ||
export * from './pusher-connector'; | ||
export * from './socketio-connector'; | ||
export * from './null-connector'; |
import { EventFormatter } from './util'; | ||
import { Channel, PresenceChannel } from './channel' | ||
import { PusherConnector, SocketIoConnector } from './connector'; | ||
import { PusherConnector, SocketIoConnector, NullConnector } from './connector'; | ||
@@ -48,2 +48,4 @@ /** | ||
this.connector = new SocketIoConnector(this.options); | ||
} else if (this.options.broadcaster == 'null') { | ||
this.connector = new NullConnector(this.options); | ||
} | ||
@@ -50,0 +52,0 @@ } |
65096
31
2099
11