Created
February 27, 2024 09:15
-
-
Save aidenybai/58ee848eb90cfa9b35bd0945425906c3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
`src/store/redux/index.js`: | |
```js | |
import { configureStore } from "@reduxjs/toolkit"; | |
import { combineReducers } from "redux"; | |
import userReducer from "./userReducer"; | |
import noteMetadataReducer from "./noteMetadataReducer"; | |
const store = configureStore({ | |
reducer: combineReducers({ | |
users: userReducer, | |
noteMetadata: noteMetadataReducer, | |
}), | |
preloadedState: { | |
users: [ | |
{ | |
id: 1, | |
name: "Alexa", | |
lastActiveDate: "2023-01-01", | |
}, | |
{ | |
id: 2, | |
name: "Jake", | |
lastActiveDate: "2023-01-04", | |
}, | |
{ | |
id: 3, | |
name: "Josh", | |
lastActiveDate: "2023-01-01", | |
}, | |
{ | |
id: 4, | |
name: "Kate", | |
lastActiveDate: "2022-08-04", | |
}, | |
{ | |
id: 5, | |
name: "Jake", | |
lastActiveDate: "2022-08-04", | |
}, | |
], | |
}, | |
}); | |
export default store; | |
``` | |
If missing info. Say "MISSING INFO". | |
What is `StoreData` defined as a TypeScript interface? Careful. Check usage of every part of the type. Output a single ```typescript``` code block. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment