mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-12-17 05:25:57 +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,
|
|
};
|