-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improvement(types): add types for the whole store
improves #43
- Loading branch information
1 parent
e941284
commit 805178b
Showing
1 changed file
with
16 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* eslint-disable import/prefer-default-export */ | ||
import { Reducer } from 'redux'; | ||
import { ProductsStateType } from '~/store/modules/products/types'; | ||
|
||
export const PRODUCTS_NAMESPACE_KEY = 'PRODUCTS_NAMESPACE'; | ||
|
||
export const INIT_DYNO_STATE = 'INIT_DYNO_STATE'; | ||
|
||
export type FullStoreShape = { | ||
[INIT_DYNO_STATE]: {}; | ||
[PRODUCTS_NAMESPACE_KEY]: ProductsStateType; | ||
}; | ||
|
||
export type StoreShape = Partial<FullStoreShape>; | ||
export type NamespaceKey = keyof StoreShape; | ||
export type ReducerMap = Partial<{ [k in NamespaceKey]: Reducer<FullStoreShape[k]> }>; |