mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-28 22:26:41 +07:00
#23 lab stats
This commit is contained in:
parent
9745b895f1
commit
11fd582453
23 changed files with 328 additions and 101 deletions
|
@ -1,5 +1,5 @@
|
|||
import { LAB_ACTIONS } from '~/redux/lab/constants';
|
||||
import { labSetList } from '~/redux/lab/actions';
|
||||
import { labSetList, labSetStats } from '~/redux/lab/actions';
|
||||
import { ILabState } from '~/redux/lab/types';
|
||||
|
||||
type LabHandler<T extends (...args: any) => any> = (
|
||||
|
@ -15,6 +15,15 @@ const setList: LabHandler<typeof labSetList> = (state, { list }) => ({
|
|||
},
|
||||
});
|
||||
|
||||
const setStats: LabHandler<typeof labSetStats> = (state, { stats }) => ({
|
||||
...state,
|
||||
stats: {
|
||||
...state.stats,
|
||||
...stats,
|
||||
},
|
||||
});
|
||||
|
||||
export const LAB_HANDLERS = {
|
||||
[LAB_ACTIONS.SET_LIST]: setList,
|
||||
[LAB_ACTIONS.SET_STATS]: setStats,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue