-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allow multiple data arguments when publishing a topic
- Loading branch information
Showing
8 changed files
with
112 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "georapbox.pubsub.js", | ||
"version": "3.2.5", | ||
"version": "3.2.7", | ||
"homepage": "https://github.com/georapbox/PubSub", | ||
"authors": [ | ||
"George Raptis <[email protected]>" | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
* PubSub.js | ||
* Javascript implementation of the Publish/Subscribe pattern. | ||
* | ||
* @version 3.2.6 | ||
* @version 3.2.7 | ||
* @author George Raptis <[email protected]> (georapbox.github.io) | ||
* @homepage https://github.com/georapbox/PubSub#readme | ||
* @repository https://github.com/georapbox/PubSub.git | ||
|
@@ -186,7 +186,7 @@ | |
* @memberof PubSub | ||
* @this {PubSub} | ||
* @param {string} topic The topic's name | ||
* @param {*} [data] The data to be passed to its subscribers | ||
* @param {...*} [data] The data to be passed to its subscribers | ||
* @return {boolean} Returns `true` if topic exists and event is published; otheriwse `false` | ||
* @example | ||
* | ||
|
@@ -197,7 +197,8 @@ | |
* }); | ||
*/ | ||
PubSub.prototype.publish = function (topic, data) { | ||
return publish(this, topic, data, false); | ||
var dataArgs = Array.prototype.slice.call(arguments, 1); | ||
return publish(this, topic, dataArgs.length <= 1 ? data : dataArgs, false); | ||
}; | ||
|
||
/** | ||
|
@@ -206,7 +207,7 @@ | |
* @memberof PubSub | ||
* @this {PubSub} | ||
* @param {string} topic The topic's name | ||
* @param {*} [data] The data to be passed to its subscribers | ||
* @param {...*} [data] The data to be passed to its subscribers | ||
* @return {boolean} Returns `true` if topic exists and event is published; otheriwse `false` | ||
* @example | ||
* | ||
|
@@ -217,7 +218,8 @@ | |
* }); | ||
*/ | ||
PubSub.prototype.publishSync = function (topic, data) { | ||
return publish(this, topic, data, true); | ||
var dataArgs = Array.prototype.slice.call(arguments, 1); | ||
return publish(this, topic, dataArgs.length <= 1 ? data : dataArgs, true); | ||
}; | ||
|
||
/** | ||
|
Oops, something went wrong.