make target store optional

pull/954/head
Rich Harris 7 years ago
parent 47547ed0ab
commit adc248f639

@ -149,7 +149,8 @@ assign(Store.prototype, {
}
});
function combineStores(store, children) {
function combineStores(children, store) {
if (!store) store = new Store();
var updates = {};
for (const key in children) {

@ -160,7 +160,7 @@ describe.only('store', () => {
b.compute('z', ['x', 'y'], (x, y) => x + y);
const c = combineStores(new Store(), { a, b });
const c = combineStores({ a, b });
c.compute('total', ['a', 'b'], (a, b) => a.z + b.z);

Loading…
Cancel
Save