VK
при создании стора в
applyMiddleware
пихаю thunk, но когда в одном из action'ов я возвращаю обьект с данными, которые я получил по апишечке, то кидает ошибку, молactions must be plain objects. use custom middleware for async actions.
Size: a a a
VK
applyMiddleware
пихаю thunk, но когда в одном из action'ов я возвращаю обьект с данными, которые я получил по апишечке, то кидает ошибку, молactions must be plain objects. use custom middleware for async actions.
C
K
fetch(`https://api.openweathermap.org/data/2.5/weather?q=${city}&appid=${apiKey}`)
.then(response => response.json())
.then(weather => {
console.log(weather);
return {
type: CITY_WEATHER,
payload: weather
}
});
}
cityWeather
, который я вызываю через dispatch(cityWeather(city))
R
VK
fetch(`https://api.openweathermap.org/data/2.5/weather?q=${city}&appid=${apiKey}`)
.then(response => response.json())
.then(weather => {
console.log(weather);
return {
type: CITY_WEATHER,
payload: weather
}
});
}
cityWeather
, который я вызываю через dispatch(cityWeather(city))
C
fetch(`https://api.openweathermap.org/data/2.5/weather?q=${city}&appid=${apiKey}`)
.then(response => response.json())
.then(weather => {
console.log(weather);
return {
type: CITY_WEATHER,
payload: weather
}
});
}
cityWeather
, который я вызываю через dispatch(cityWeather(city))
1
АБ
VK
C
C
VK
1
VK
C
1
SB
VK
VK
А