Skip to content

Instantly share code, notes, and snippets.

@jdjkelly
Created July 6, 2021 00:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdjkelly/f099a28afa321ee0a610d134901c9ab9 to your computer and use it in GitHub Desktop.
Save jdjkelly/f099a28afa321ee0a610d134901c9ab9 to your computer and use it in GitHub Desktop.
import Resource from "../resources"
export type Status = 'create' | 'updated' | 'deleted' | 'recreated';
type IStore = {
[key in Resource]: {
id: {
id: string;
txid: number;
ts: number;
status: Status;
resource: Resource;
};
};
};
type IAction = string;
type Reducer = (state: IStore, action: IAction) => IStore;
export default function createStore(reducer: Reducer, initialState?: IStore): Reducer {
return reducer
}
createStore((state, action) => { return state });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment