mirror of
https://github.com/Hopiu/postal.js.git
synced 2026-05-03 21:04:42 +00:00
Moved system level messages out of SubscriptionDefinition; added postal.unsubscribe and removed unnecessary refs to localBus and replaced with module ref of same calls
This commit is contained in:
parent
3b5b235227
commit
92c242c096
4 changed files with 9 additions and 9 deletions
|
|
@ -73,7 +73,7 @@
|
|||
arguments[0]) :
|
||||
{ topic : arguments[0], data : arguments[1] };
|
||||
envelope.channel = this.channel;
|
||||
return postal.configuration.bus.publish( envelope );
|
||||
return postal.publish( envelope );
|
||||
};
|
||||
var SubscriptionDefinition = function ( channel, topic, callback ) {
|
||||
this.channel = channel;
|
||||
|
|
@ -83,9 +83,9 @@
|
|||
this.context = null;
|
||||
};
|
||||
|
||||
SubscriptionDefinition.prototype = {
|
||||
_.extend( SubscriptionDefinition.prototype, {
|
||||
unsubscribe : function () {
|
||||
if(!this.inactive) {
|
||||
if( !this.inactive ) {
|
||||
this.inactive = true;
|
||||
postal.unsubscribe( this );
|
||||
}
|
||||
|
|
@ -190,7 +190,7 @@
|
|||
this.callback = callback;
|
||||
return this;
|
||||
}
|
||||
};
|
||||
});
|
||||
var bindingsResolver = {
|
||||
cache : {},
|
||||
regex : {},
|
||||
|
|
|
|||
2
lib/postal.min.js
vendored
2
lib/postal.min.js
vendored
File diff suppressed because one or more lines are too long
|
|
@ -15,5 +15,5 @@ ChannelDefinition.prototype.publish = function () {
|
|||
arguments[0]) :
|
||||
{ topic : arguments[0], data : arguments[1] };
|
||||
envelope.channel = this.channel;
|
||||
return postal.configuration.bus.publish( envelope );
|
||||
return postal.publish( envelope );
|
||||
};
|
||||
|
|
@ -6,9 +6,9 @@ var SubscriptionDefinition = function ( channel, topic, callback ) {
|
|||
this.context = null;
|
||||
};
|
||||
|
||||
SubscriptionDefinition.prototype = {
|
||||
_.extend( SubscriptionDefinition.prototype, {
|
||||
unsubscribe : function () {
|
||||
if(!this.inactive) {
|
||||
if( !this.inactive ) {
|
||||
this.inactive = true;
|
||||
postal.unsubscribe( this );
|
||||
}
|
||||
|
|
@ -113,4 +113,4 @@ SubscriptionDefinition.prototype = {
|
|||
this.callback = callback;
|
||||
return this;
|
||||
}
|
||||
};
|
||||
});
|
||||
Loading…
Reference in a new issue