Created
August 23, 2018 14:49
-
-
Save matthew-gerstman/d39a0f0ffe2abff61ff057ca94fa4765 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| //redux-utils/types.ts | |
| import { MuggleNamespaceShape } from "../data/muggles/types"; | |
| import { WizardNamespaceShape } from "../data/wizards/types"; | |
| import { Reducer } from "redux"; | |
| export const MUGGLE_NAMESPACE_KEY = "MUGGLE_NAMESPACE"; | |
| export const WIZARD_NAMESPACE_KEY = "WIZARD_NAMESPACE"; | |
| export type FullStoreShape = { | |
| [MUGGLE_NAMESPACE_KEY]: MuggleNamespaceShape; | |
| [WIZARD_NAMESPACE_KEY]: WizardNamespaceShape; | |
| }; | |
| export type StoreShape = Partial<FullStoreShape>; | |
| export type NamespaceKey = keyof StoreShape; | |
| export type ReducerMap = Partial< | |
| { [k in NamespaceKey]: Reducer<StoreShape[k]> } | |
| >; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment