diff --git a/bower.json b/bower.json index f38df7a..33413a7 100644 --- a/bower.json +++ b/bower.json @@ -1,10 +1,13 @@ { "name": "knockout-postbox", - "version": "0.5.1", + "version": "0.5.2", "main": "build/knockout-postbox.min.js", "dependencies": { "knockout": ">= 2.0" }, + "publishConfig": { + "registry": "https://registry.npmjs.org" + }, "ignore": [ "examples", "ext", diff --git a/build/knockout-postbox.js b/build/knockout-postbox.js index 37adb0f..2a2e596 100644 --- a/build/knockout-postbox.js +++ b/build/knockout-postbox.js @@ -1,4 +1,4 @@ -// knockout-postbox 0.5.1 | (c) 2015 Ryan Niemeyer | http://www.opensource.org/licenses/mit-license +// knockout-postbox 0.5.2 | (c) 2015 Ryan Niemeyer | http://www.opensource.org/licenses/mit-license ;(function(factory) { //CommonJS if (typeof require === "function" && typeof exports === "object" && typeof module === "object") { diff --git a/build/knockout-postbox.min.js b/build/knockout-postbox.min.js index c7ff726..49ba047 100644 --- a/build/knockout-postbox.min.js +++ b/build/knockout-postbox.min.js @@ -1,2 +1,2 @@ -// knockout-postbox 0.5.1 | (c) 2015 Ryan Niemeyer | http://www.opensource.org/licenses/mit-license +// knockout-postbox 0.5.2 | (c) 2015 Ryan Niemeyer | http://www.opensource.org/licenses/mit-license !function(a){"function"==typeof require&&"object"==typeof exports&&"object"==typeof module?a(require("knockout"),exports):"function"==typeof define&&define.amd?define(["knockout","exports"],a):a(ko,ko.postbox={})}(function(a,b,c){var d,e,f={},g=1;b.subscriptions=f,a.subscribable.call(b),b.topicCache={},b.serializer=a.toJSON,b.publish=function(a,c){a&&(b.topicCache[a]={value:c,serialized:b.serializer(c)},b.notifySubscribers(c,a))},e=b.subscribe,b.subscribe=function(a,d,h,i){var j,k,l;return a?("boolean"==typeof h&&(i=h,h=c),j=e.call(b,d,h,a),j.subId=++g,f[g]=j,i&&(k=b.topicCache[a],k!==c&&d.call(h,k.value)),l=j.dispose,j.dispose=function(){delete f[j.subId],l.call(j)},j):void 0},b.reset=function(){var a;for(var c in f)f.hasOwnProperty(c)&&(a=f[c],a&&"function"==typeof a.dispose&&a.dispose());b.topicCache={}},b.defaultComparer=function(a,c){return c&&b.serializer(a)===c.serialized},a.subscribable.fn.publishOn=function(a,c,e){var h,i,j;return a&&("function"==typeof c?e=c:h=c,e=e||b.defaultComparer,d.call(this,a,"publishOn"),i=this.subscribe(function(c){e.call(this,c,b.topicCache[a])||b.publish(a,c)},this),i.id=++g,f[g]=i,j=i.dispose,i.dispose=function(){delete this.postboxSubs[a].publishOn,delete f[i.id],j.call(i)}.bind(this),this.postboxSubs[a].publishOn=i,h||b.publish(a,this())),this},d=function(a,b){var c=this.postboxSubs=this.postboxSubs||{};c[a]=c[a]||{},c[a][b]&&c[a][b].dispose()},a.subscribable.fn.stopPublishingOn=function(a){return d.call(this,a,"publishOn"),this},a.subscribable.fn.subscribeTo=function(e,f,g){var h,i,j,k,l,m=this;return"function"==typeof f?g=f:h=f,e&&a.isWriteableObservable(this)&&(d.call(this,e,"subscribeTo"),j=function(a){m(g?g.call(m,a):a)},k=b.subscribe(e,j),this.postboxSubs[e].subscribeTo=k,l=k.dispose,k.dispose=function(){delete this.postboxSubs[e].subscribeTo,l.call(k)}.bind(this),h&&(i=b.topicCache[e],i!==c&&j(i.value))),this},a.subscribable.fn.unsubscribeFrom=function(a){return d.call(this,a,"subscribeTo"),this},a.subscribable.fn.syncWith=function(a,b,c,d){return this.subscribeTo(a,b).publishOn(a,c,d),this},a.postbox=b}); \ No newline at end of file diff --git a/package.json b/package.json index 48e5761..be6f801 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "knockout-postbox", - "version": "0.5.1", + "version": "0.5.2", "repository": { "type": "git", "url": "git://github.com/rniemeyer/knockout-postbox.git"