diff --git a/src/features/Pokedex/pokedexSlice.ts b/src/features/Pokedex/pokedexSlice.ts index ddb283e..45b1f69 100644 --- a/src/features/Pokedex/pokedexSlice.ts +++ b/src/features/Pokedex/pokedexSlice.ts @@ -24,7 +24,7 @@ export const fetchPokemonsInTheRegion = createAsyncThunk< { length: endId - startId + 1 }, (_, i) => i + startId, ); - // use pokemonIds to fetch pokemon data using fetch, remember to clear all fetched cache after saving data into store + // use pokemonIds to fetch pokemon data using fetch, which won't save the data in the cache const pokemonList = await Promise.all( pokemonIds.map( id => @@ -38,13 +38,6 @@ export const fetchPokemonsInTheRegion = createAsyncThunk< (pokemon: PokemonResponseData) => pokemon, ); - // TODO: Fix this cache clearing, as running it cause proble in browser console - // clear all fetched data cache - // pokemonIds.forEach(id => { - // const cacheKey = `https://pokeapi.co/api/v2/pokemon/${id}`; - // delete (window as any).fetch.cache[cacheKey]; - // }); - return pokemonListData; });