Przeglądaj źródła

fix: calling helpers on any store

Ryan Chandler 4 lat temu
rodzic
commit
0d5a351dca

Plik diff jest za duży
+ 0 - 0
dist/spruce.js


Plik diff jest za duży
+ 0 - 0
dist/spruce.js.map


Plik diff jest za duży
+ 0 - 0
dist/spruce.module.js


Plik diff jest za duży
+ 0 - 0
dist/spruce.module.js.map


Plik diff jest za duży
+ 0 - 0
dist/spruce.umd.js


Plik diff jest za duży
+ 0 - 0
dist/spruce.umd.js.map


+ 1 - 1
src/index.js

@@ -27,7 +27,7 @@ const Spruce = {
 
 
         this.stores = createObservable(this.stores, {
         this.stores = createObservable(this.stores, {
             get: (target, key, receiver) => {
             get: (target, key, receiver) => {
-                if (['get', 'set', 'toggle', 'clear'].includes(key)) {
+                if (Object.is(receiver, this.stores) && ['get', 'set', 'toggle', 'clear'].includes(key)) {
                     return this[key].bind(this)
                     return this[key].bind(this)
                 }
                 }
 
 

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików