I have the following slice and function. How can I get values stored in my initialState?
const example = createSlice({
name: "example",
initialState: {
firstName: hello,
lastName: world
},
reducers: {}
})
export const create = (id) => {
return async (dispatch) => {
const currentState = getState()
console.log(currentState)
};
};
Do I have to use useSelector and pass values down to the function again? Ideally would like to get data directly from the already saved state