mirror of
https://github.com/Hopiu/postal.js.git
synced 2026-03-16 22:20:23 +00:00
Trimmed more code out
This commit is contained in:
parent
3acbb142e6
commit
fb4e9ae71a
5 changed files with 16 additions and 36 deletions
|
|
@ -306,9 +306,7 @@
|
|||
}
|
||||
}
|
||||
};
|
||||
// save some setup time, albeit tiny
|
||||
localBus.subscriptions[SYSTEM_CHANNEL] = {};
|
||||
|
||||
var postal = {
|
||||
configuration : {
|
||||
bus : localBus,
|
||||
|
|
@ -318,7 +316,6 @@
|
|||
},
|
||||
|
||||
ChannelDefinition : ChannelDefinition,
|
||||
|
||||
SubscriptionDefinition : SubscriptionDefinition,
|
||||
|
||||
channel : function ( channelName ) {
|
||||
|
|
@ -367,23 +364,16 @@
|
|||
utils : {
|
||||
getSubscribersFor : function () {
|
||||
var channel = arguments[ 0 ],
|
||||
tpc = arguments[ 1 ],
|
||||
result = [];
|
||||
tpc = arguments[ 1 ];
|
||||
if ( arguments.length === 1 ) {
|
||||
if ( Object.prototype.toString.call( channel ) === "[object String]" ) {
|
||||
channel = postal.configuration.DEFAULT_CHANNEL;
|
||||
tpc = arguments[ 0 ];
|
||||
}
|
||||
else {
|
||||
channel = arguments[ 0 ].channel || postal.configuration.DEFAULT_CHANNEL;
|
||||
tpc = arguments[ 0 ].topic;
|
||||
}
|
||||
channel = arguments[ 0 ].channel || postal.configuration.DEFAULT_CHANNEL;
|
||||
tpc = arguments[ 0 ].topic;
|
||||
}
|
||||
if ( postal.configuration.bus.subscriptions[ channel ] &&
|
||||
postal.configuration.bus.subscriptions[ channel ].hasOwnProperty( tpc ) ) {
|
||||
result = postal.configuration.bus.subscriptions[ channel ][ tpc ];
|
||||
return postal.configuration.bus.subscriptions[ channel ][ tpc ];
|
||||
}
|
||||
return result;
|
||||
return [];
|
||||
},
|
||||
|
||||
reset : function () {
|
||||
|
|
|
|||
2
lib/postal.min.js
vendored
2
lib/postal.min.js
vendored
File diff suppressed because one or more lines are too long
|
|
@ -20,9 +20,9 @@
|
|||
"url" : "http://freshbrewedcode.com/alexrobson"
|
||||
},
|
||||
{
|
||||
"name" : "Nicholas Cloud",
|
||||
"email" : "WhyNotJustComment@OnMyBlog.com",
|
||||
"url" : "http://nicholascloud.com"
|
||||
"name" : "Nicholas Cloud",
|
||||
"email" : "WhyNotJustComment@OnMyBlog.com",
|
||||
"url" : "http://nicholascloud.com"
|
||||
},
|
||||
{
|
||||
"name" : "Doug Neiner",
|
||||
|
|
|
|||
21
src/Api.js
21
src/Api.js
|
|
@ -1,6 +1,3 @@
|
|||
// save some setup time, albeit tiny
|
||||
localBus.subscriptions[SYSTEM_CHANNEL] = {};
|
||||
|
||||
var postal = {
|
||||
configuration : {
|
||||
bus : localBus,
|
||||
|
|
@ -10,7 +7,6 @@ var postal = {
|
|||
},
|
||||
|
||||
ChannelDefinition : ChannelDefinition,
|
||||
|
||||
SubscriptionDefinition : SubscriptionDefinition,
|
||||
|
||||
channel : function ( channelName ) {
|
||||
|
|
@ -59,23 +55,16 @@ var postal = {
|
|||
utils : {
|
||||
getSubscribersFor : function () {
|
||||
var channel = arguments[ 0 ],
|
||||
tpc = arguments[ 1 ],
|
||||
result = [];
|
||||
tpc = arguments[ 1 ];
|
||||
if ( arguments.length === 1 ) {
|
||||
if ( Object.prototype.toString.call( channel ) === "[object String]" ) {
|
||||
channel = postal.configuration.DEFAULT_CHANNEL;
|
||||
tpc = arguments[ 0 ];
|
||||
}
|
||||
else {
|
||||
channel = arguments[ 0 ].channel || postal.configuration.DEFAULT_CHANNEL;
|
||||
tpc = arguments[ 0 ].topic;
|
||||
}
|
||||
channel = arguments[ 0 ].channel || postal.configuration.DEFAULT_CHANNEL;
|
||||
tpc = arguments[ 0 ].topic;
|
||||
}
|
||||
if ( postal.configuration.bus.subscriptions[ channel ] &&
|
||||
postal.configuration.bus.subscriptions[ channel ].hasOwnProperty( tpc ) ) {
|
||||
result = postal.configuration.bus.subscriptions[ channel ][ tpc ];
|
||||
return postal.configuration.bus.subscriptions[ channel ][ tpc ];
|
||||
}
|
||||
return result;
|
||||
return [];
|
||||
},
|
||||
|
||||
reset : function () {
|
||||
|
|
|
|||
|
|
@ -76,4 +76,5 @@ var localBus = {
|
|||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
localBus.subscriptions[SYSTEM_CHANNEL] = {};
|
||||
Loading…
Reference in a new issue