PromucFlow_constructor/app/client/src/reducers/uiReducers/releasesReducer.ts
Valera Melnikov 9eac55a380
chore: add consistent-type-definitions rule (#27907)
## Description
Add consistent-type-definitions rule
2023-10-11 10:35:24 +03:00

27 lines
752 B
TypeScript

import { createReducer } from "utils/ReducerUtils";
import type { ReduxAction } from "@appsmith/constants/ReduxActionConstants";
import { ReduxActionTypes } from "@appsmith/constants/ReduxActionConstants";
const initialState: ReleasesState = {
newReleasesCount: "",
releaseItems: [],
};
const importReducer = createReducer(initialState, {
[ReduxActionTypes.FETCH_RELEASES_SUCCESS]: (
_state: ReleasesState,
action: ReduxAction<{ payload: Record<string, unknown> }>,
) => action.payload,
[ReduxActionTypes.RESET_UNREAD_RELEASES_COUNT]: (state: ReleasesState) => ({
...state,
newReleasesCount: "",
}),
});
export interface ReleasesState {
newReleasesCount: string;
releaseItems: any[];
}
export default importReducer;