Skip to content

Make socket.on/socket.addListener chainable. Fixes #81 #123

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@

.idea
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these changes are unrelated

atlassian-ide-plugin.xml

coverage/
node_modules/
bower_components/
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-socket-io",
"version": "0.7.0",
"version": "0.7.1",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should not bump versions in a PR

"main": "socket.js",
"dependencies": {
"angular": "^1.2.6"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-socket-io",
"version": "0.7.0",
"version": "0.7.1",
"main": "socket.js",
"directories": {
"test": "test"
Expand Down
6 changes: 3 additions & 3 deletions socket.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* @license
* angular-socket-io v0.7.0
* angular-socket-io v0.7.1
* (c) 2014 Brian Ford http://briantford.com
* License: MIT
*/
Expand Down Expand Up @@ -33,11 +33,11 @@ angular.module('btford.socket-io', []).
var defaultScope = options.scope || $rootScope;

var addListener = function (eventName, callback) {
socket.on(eventName, callback.__ng = asyncAngularify(socket, callback));
return socket.on(eventName, callback.__ng = asyncAngularify(socket, callback));
};

var addOnceListener = function (eventName, callback) {
socket.once(eventName, callback.__ng = asyncAngularify(socket, callback));
return socket.once(eventName, callback.__ng = asyncAngularify(socket, callback));
};

var wrappedSocket = {
Expand Down
4 changes: 2 additions & 2 deletions socket.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion socket.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.