mirror of
https://github.com/linux-do/new-api.git
synced 2025-09-17 16:06:38 +08:00
21 lines
341 B
JavaScript
21 lines
341 B
JavaScript
export const reducer = (state, action) => {
|
|
switch (action.type) {
|
|
case 'set':
|
|
return {
|
|
...state,
|
|
status: action.payload,
|
|
};
|
|
case 'unset':
|
|
return {
|
|
...state,
|
|
status: undefined,
|
|
};
|
|
default:
|
|
return state;
|
|
}
|
|
};
|
|
|
|
export const initialState = {
|
|
status: undefined,
|
|
};
|