Renamed PokedexState to PokedexStateProps for type

This commit is contained in:
Jason Zhu 2023-05-11 20:55:53 +10:00
parent 08c8af5f4f
commit f8fb41e837
2 changed files with 4 additions and 4 deletions

View File

@ -1,7 +1,7 @@
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
import type { Slice, PayloadAction } from '@reduxjs/toolkit';
import { PokedexState } from 'features/Pokedex/types/slice';
import { PokedexStateProps } from 'features/Pokedex/types/slice';
import { getStartAndEndIdsForRegion } from './utils';
import { PokemonResponseData } from 'types/api';
@ -39,12 +39,12 @@ export const fetchPokemonsInTheRegion = createAsyncThunk<
return pokemonListData;
});
const initialState: PokedexState = {
export const initialState: PokedexStateProps = {
isLoadingPokemons: true,
pokemonCardList: [],
};
export const pokedexSlice: Slice<PokedexState> = createSlice({
export const pokedexSlice: Slice<PokedexStateProps> = createSlice({
name: 'pokedex',
initialState,
reducers: {

View File

@ -1,6 +1,6 @@
import { PokemonCardProps } from 'components/PokemonCard';
export type PokedexState = {
export type PokedexStateProps = {
isLoadingPokemons: boolean;
pokemonCardList: PokemonCardProps[];
};