pulsar-web/src/store/reducers.ts

15 lines
540 B
TypeScript

import { IState } from "./types";
import { Action } from "./actions";
import { AuthAction, authReducer } from "./auth";
import { UserAction, userReducer } from "./user";
import { CommunityAction, communityReducer } from "./community";
function reducer(state: IState, action: Action): IState {
return {
auth: authReducer(state.auth, action as AuthAction),
user: userReducer(state.user, action as UserAction),
community: communityReducer(state.community, action as CommunityAction),
};
}
export { reducer };