Skip to content

Instantly share code, notes, and snippets.

@matthew-gerstman
Last active August 23, 2018 15:51
Show Gist options
  • Save matthew-gerstman/d0b181b8516a78d534f68ba4cfa9a2aa to your computer and use it in GitHub Desktop.
Save matthew-gerstman/d0b181b8516a78d534f68ba4cfa9a2aa to your computer and use it in GitHub Desktop.
//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