Commit 221fb797 by Иван Кубота

experimental prop. for back compat until wip

parent 49ca24e3
...@@ -9,6 +9,7 @@ const Store = function(cfg) { ...@@ -9,6 +9,7 @@ const Store = function(cfg) {
}; };
Store.prototype = { Store.prototype = {
experimental: false,
_set: function(keys, val, pointer, path){ _set: function(keys, val, pointer, path){
let i, _i; let i, _i;
let key = keys[path.length]; let key = keys[path.length];
...@@ -25,6 +26,13 @@ Store.prototype = { ...@@ -25,6 +26,13 @@ Store.prototype = {
} }
}, },
set: function(key, val) { set: function(key, val) {
if(!this.experimental)
if(this._props[key] !== val){
this._props[ key ] = val;
this.fire( 'change', key, val );
this.fire( key, val );
}
return this._set( return this._set(
typeof key === 'string' ? key.split('.') : key, typeof key === 'string' ? key.split('.') : key,
val, val,
...@@ -33,6 +41,9 @@ Store.prototype = { ...@@ -33,6 +41,9 @@ Store.prototype = {
); );
}, },
get: function(key, returnLastStore) { get: function(key, returnLastStore) {
if(!this.experimental)
return this._props[key];
key = typeof key === 'string' ? key.split('.') : key; key = typeof key === 'string' ? key.split('.') : key;
let ref = this, let ref = this,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment