We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3e9e484 commit 9e8a320Copy full SHA for 9e8a320
test/typescript/store.ts
@@ -61,6 +61,11 @@ const funcWithStore = (store: Store<State, DerivedAction>) => {}
61
62
const store: Store<State> = createStore(reducer)
63
64
+// test that nullable state is preserved
65
+const nullableStore = createStore((): string | null => null)
66
+
67
+expectTypeOf(nullableStore.getState()).toEqualTypeOf<string | null>()
68
69
// ensure that an array-based state works
70
const arrayReducer = (state: any[] = []) => state || []
71
const storeWithArrayState: Store<any[]> = createStore(arrayReducer)
0 commit comments