From 451d2f540a1445cf66e2556e559db08851150b1d Mon Sep 17 00:00:00 2001 From: Anthony Gubler Date: Tue, 26 Feb 2019 11:15:42 +0000 Subject: [PATCH] Default stateKey to 'state' (#273) --- src/stores/StoreProvider.ts | 15 +++++++++++---- tests/stores/unit/StoreProvider.ts | 2 +- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/stores/StoreProvider.ts b/src/stores/StoreProvider.ts index f4283650c..a0a8b9fb4 100644 --- a/src/stores/StoreProvider.ts +++ b/src/stores/StoreProvider.ts @@ -12,7 +12,7 @@ export interface GetPaths { export interface StoreProviderProperties { renderer: (store: Store) => DNode | DNode[]; - stateKey: string; + stateKey?: string; paths?: GetPaths; } @@ -41,10 +41,14 @@ export class StoreProvider extends WidgetBase extends WidgetBase { const container = new TestContainer(); container.registry.base = registry; container.__setProperties__({ - stateKey: 'state', renderer(injectedStore) { assert.strictEqual(injectedStore, store); return v('div'); } }); + container.__render__(); invalidateCount = 0; fooProcess(store)({}); assert.strictEqual(invalidateCount, 1);