feat: introducing self hosted admin dashboard package (#12)

Co-authored-by: Andrew Bastin <andrewbastin.k@gmail.com>
Co-authored-by: Anwarul Islam <anwaarulislaam@gmail.com>
This commit is contained in:
Joel Jacob Stephen
2023-02-28 13:13:27 +05:30
committed by GitHub
parent 2ba05a46ee
commit 3f59597864
219 changed files with 6737 additions and 1967 deletions

View File

@@ -11,14 +11,18 @@ const defaultLocalState: LocalState = {
REMEMBERED_TEAM_ID: undefined,
}
type ApplyLocalState = {
[K in keyof LocalState]: {
key: K
value: LocalState[K]
}
}[keyof LocalState]
const dispatchers = defineDispatchers({
bulkApplyState(_currentState: LocalState, payload: Partial<LocalState>) {
return payload
},
applyState<K extends keyof LocalState>(
_currentState: LocalState,
{ key, value }: { key: K; value: LocalState[K] }
) {
applyState(_currentState: LocalState, { key, value }: ApplyLocalState) {
const result: Partial<LocalState> = {
[key]: value,
}