Last active
August 23, 2018 15:51
-
-
Save matthew-gerstman/d0b181b8516a78d534f68ba4cfa9a2aa to your computer and use it in GitHub Desktop.
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
//redux-utils/types.ts | |
import { Reducer } from "redux"; | |
import { MuggleNamespaceShape } from "../data/muggles/types"; | |
import { WizardNamespaceShape } from "../data/wizards/types"; | |
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<FullStoreShape[k]> } | |
>; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment