Renamed PokedexState to PokedexStateProps for type
This commit is contained in:
parent
08c8af5f4f
commit
f8fb41e837
@ -1,7 +1,7 @@
|
|||||||
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
||||||
import type { Slice, PayloadAction } 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 { getStartAndEndIdsForRegion } from './utils';
|
||||||
import { PokemonResponseData } from 'types/api';
|
import { PokemonResponseData } from 'types/api';
|
||||||
@ -39,12 +39,12 @@ export const fetchPokemonsInTheRegion = createAsyncThunk<
|
|||||||
return pokemonListData;
|
return pokemonListData;
|
||||||
});
|
});
|
||||||
|
|
||||||
const initialState: PokedexState = {
|
export const initialState: PokedexStateProps = {
|
||||||
isLoadingPokemons: true,
|
isLoadingPokemons: true,
|
||||||
pokemonCardList: [],
|
pokemonCardList: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
export const pokedexSlice: Slice<PokedexState> = createSlice({
|
export const pokedexSlice: Slice<PokedexStateProps> = createSlice({
|
||||||
name: 'pokedex',
|
name: 'pokedex',
|
||||||
initialState,
|
initialState,
|
||||||
reducers: {
|
reducers: {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { PokemonCardProps } from 'components/PokemonCard';
|
import { PokemonCardProps } from 'components/PokemonCard';
|
||||||
|
|
||||||
export type PokedexState = {
|
export type PokedexStateProps = {
|
||||||
isLoadingPokemons: boolean;
|
isLoadingPokemons: boolean;
|
||||||
pokemonCardList: PokemonCardProps[];
|
pokemonCardList: PokemonCardProps[];
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user