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:
committed by
GitHub
parent
2ba05a46ee
commit
3f59597864
@@ -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,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user