Skip to content
This repository has been archived by the owner on Aug 29, 2018. It is now read-only.

Commit

Permalink
wrapping clients() response to handle both arrays and objects. Closes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
ekryski committed Jan 6, 2016
1 parent d1e5d6f commit 858a264
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/sockets/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function setupEventHandlers(info, service, path) {
service[ev] : defaultDispatcher;
let eventName = `${path} ${ev}`;

info.clients().forEach(function (socket) {
Object.keys(info.clients()).forEach(function (socket) {
dispatcher.call(service, data, info.params(socket), function (error, dispatchData) {
if (error) {
socket[info.method]('error', error);
Expand Down
2 changes: 1 addition & 1 deletion src/sockets/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function service(path, obj) {
// Set up event handlers for this new service
_setupEventHandlers(protoService, location);
// For any existing connection add method handlers
info.clients().forEach(socket => _setupMethodHandlers(socket, location, protoService));
Object.keys(info.clients()).forEach(socket => _setupMethodHandlers(socket, location, protoService));
}

return protoService;
Expand Down

0 comments on commit 858a264

Please sign in to comment.