Skip to content

Commit

Permalink
release v2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Berkeley Martinez authored and Berkeley Martinez committed Jul 31, 2015
1 parent 30dbb70 commit 5b789a5
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 10 deletions.
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# July 30, 2015 v2.1.0

* [30dbb70](../../commit/30dbb70) add store.shouldStoreNotify
* [e73938d](../../commit/e73938d) add cat.dispose

# July 21, 2015 v2.0.0

This release has major breaking changes!
Expand Down
33 changes: 27 additions & 6 deletions lib/umd/ThunderCats.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* ThunderCats - RxJS Meets isomorphic Flux
* @version v2.0.0
* @version v2.1.0
* @link http://thundercats.js.org
* @license MIT
* @author Berkeley Martinez (http://r3dm.com)
Expand Down Expand Up @@ -2188,6 +2188,13 @@ return /******/ (function(modules) { // webpackBootstrap
get: function get(storeOrActions) {
var possibleStore = this.getStore(storeOrActions);
return possibleStore ? possibleStore : this.getActions(storeOrActions);
},

dispose: function dispose() {
debug('dispose all the things');
this.stores.forEach(function (store) {
store.dispose();
});
}
};

Expand Down Expand Up @@ -2322,7 +2329,7 @@ return /******/ (function(modules) { // webpackBootstrap
});
}

function dispose(subscription) {
function _dispose(subscription) {
if (subscription) {
subscription.dispose();
}
Expand All @@ -2345,7 +2352,7 @@ return /******/ (function(modules) { // webpackBootstrap

_init: function _init() {
debug('initiating %s', (0, _utils.getName)(this));
this.history = dispose(this._operationsSubscription, this.history);
this.history = _dispose(this._operationsSubscription, this.history);

(0, _invariant2['default'])(this.actions.length, '%s must have at least one action to listen to but has %s', (0, _utils.getName)(this), this.actions.length);

Expand Down Expand Up @@ -2381,13 +2388,21 @@ return /******/ (function(modules) { // webpackBootstrap
var newValue = applyOperation(this.value, ops);

if (!newValue) {
// operational noop,
debug('%s operational noop', (0, _utils.getName)(this));
// do not change value
// do not update history
// do not collect 200 dollars
return;
}

// if shouldStoreNotify returns false
// do not change value or update history
// else continue as normal
if (this.shouldStoreNotify && typeof this.shouldStoreNotify === 'function' && !this.shouldStoreNotify(oldValue, newValue)) {
debug('%s will not notify', (0, _utils.getName)(this));
return;
}

this.value = newValue;
notifyObservers(this.value, this.observers);

Expand Down Expand Up @@ -2448,12 +2463,18 @@ return /******/ (function(modules) { // webpackBootstrap
_this2.observers['delete'](uid);
/* istanbul ignore else */
if (!_this2.hasObservers()) {
debug('All observers disposed, disposing operations observer');
_this2.history = dispose(_this2._operationsSubscription, _this2.history);
debug('all observers cleared');
_this2.dispose();
}
});
},

dispose: function dispose() {
debug('disposing %s', (0, _utils.getName)(this));
this.observers = new Map();
this.history = _dispose(this._operationsSubscription, this.history);
},

serialize: function serialize() {
return this.value ? JSON.stringify(this.value) : '';
},
Expand Down
6 changes: 3 additions & 3 deletions lib/umd/ThunderCats.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "thundercats",
"description": "RxJS Meets isomorphic Flux",
"version": "2.0.0",
"version": "2.1.0",
"homepage": "http://thundercats.js.org",
"keywords": [
"alwaysUseTwoSpaces",
Expand Down

0 comments on commit 5b789a5

Please sign in to comment.