Trimmed more code out

This commit is contained in:
Jim Cowart 2012-12-20 02:45:05 -05:00
parent 3acbb142e6
commit fb4e9ae71a
5 changed files with 16 additions and 36 deletions

View file

@ -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

File diff suppressed because one or more lines are too long

View file

@ -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",

View file

@ -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 () {

View file

@ -76,4 +76,5 @@ var localBus = {
}
}
}
};
};
localBus.subscriptions[SYSTEM_CHANNEL] = {};