I'm fetching data from firestore and dispatching an action through redux. Right now it looks like this:
export const mildvalue = createSlice ({
name:"mild",
initialState:{text:"Press to refresh", key:1},
reducers:{
shuffleMild:(state, action) => {
console.log(action.payload)
}
}
})
And the data coming from the console log and firestore is a key/value pair and looks like this:
{"ref1": "trying text 1", "ref2": "trying text 2", "ref3": "trying text 3", "ref5": "trying text 5"}
What I WANT to do is to put this data as objects in an array so that I can shuffle through them by assigning keys etc to replace the initialState. But I don't understand how I should do this. Please help me