Created
July 6, 2021 00:42
-
-
Save jdjkelly/f099a28afa321ee0a610d134901c9ab9 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
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