corvid-storeon
Advanced tools
Comparing version
@@ -72,2 +72,3 @@ /** | ||
var store = storeon(modules); | ||
var page = []; | ||
var subs = []; | ||
@@ -90,3 +91,3 @@ | ||
subs.forEach(function (s) { | ||
page.concat(subs).forEach(function (s) { | ||
s.cb(state); | ||
@@ -115,6 +116,5 @@ }); | ||
}, | ||
connectPage: function (cb) { | ||
$w.onReady(function () { | ||
cb(store.get()); | ||
}); | ||
page.push({ cb: cb }); | ||
} | ||
@@ -121,0 +121,0 @@ }; |
@@ -76,2 +76,3 @@ 'use strict'; | ||
var store = storeon(modules); | ||
var page = []; | ||
var subs = []; | ||
@@ -94,3 +95,3 @@ | ||
subs.forEach(function (s) { | ||
page.concat(subs).forEach(function (s) { | ||
s.cb(state); | ||
@@ -119,6 +120,5 @@ }); | ||
}, | ||
connectPage: function (cb) { | ||
$w.onReady(function () { | ||
cb(store.get()); | ||
}); | ||
page.push({ cb: cb }); | ||
} | ||
@@ -125,0 +125,0 @@ }; |
{ | ||
"name": "corvid-storeon", | ||
"version": "1.1.2", | ||
"version": "1.2.0", | ||
"description": "A tiny event-based state manager Storeon for Corvid by Wix", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -76,3 +76,3 @@ # corvid-storeon | ||
### connect | ||
connect to state by property key. Will return function disconnect from the store. | ||
connect to state by property key. It will return function disconnect from the store. | ||
```js | ||
@@ -79,0 +79,0 @@ const disconnect = connect("key", (state) => { }); |
10822
-0.08%204
-0.97%