Przeglądaj źródła

refactor(always return store)

Ryan Chandler 5 lat temu
rodzic
commit
e2d09feea5

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


+ 2 - 4
src/index.js

@@ -39,13 +39,11 @@ const Spruce = {
     },
 
     store: function (name, state) {
-        if (state === undefined && this.stores[name]) {
-            return this.stores[name]
-        }
-
         if (! this.stores[name]) {
             this.stores[name] = state
         }
+
+        return this.stores[name]
     },
 
     subscribe(el) {

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