In my react app I want to pass my data (transactions) into redux. To do that I've created this reducer:
import axios from 'axios'
let data = axios.get('http://localhost:3001/transactions')
.then(res => {
return res.data
})
export default data
But when I get data to pass it to combineReducers
I get this instead of an array that can be passed and used by components
Promise {[[PromiseStatus]]: "pending", [[PromiseValue]]: undefined}
__proto__
:
Promise
[[PromiseStatus]]
:
"resolved"
[[PromiseValue]]
:
Array(10)
How can I extract that Array(10)
?