diff --git a/store.js b/store.js index 2c573b247f..9c3962d63b 100644 --- a/store.js +++ b/store.js @@ -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) { diff --git a/test/store/index.js b/test/store/index.js index 2f5666152c..246e655229 100644 --- a/test/store/index.js +++ b/test/store/index.js @@ -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);