Set up Redux Toolkit, Added redux demo to /demo route
This commit is contained in:
1 parent
637e3c54d0
commit
ccb61004bb
8 files changed
+1610
-361
No files matched your search
@@ -0,0 +1,36 @@
|
||||
import { createSlice } from "@reduxjs/toolkit";
|
||||
|
||||
const initialState = [
|
||||
{
|
||||
_id: 1,
|
||||
userId: 1,
|
||||
name: "Google",
|
||||
description: "Search engine",
|
||||
url: "https://www.google.com",
|
||||
isActive: true,
|
||||
interval: 1000,
|
||||
createdAt: "2021-01",
|
||||
updatedAt: "2021-01",
|
||||
},
|
||||
{
|
||||
_id: 2,
|
||||
userId: 1,
|
||||
name: "Yahoo",
|
||||
description: "Search engine",
|
||||
url: "https://www.yahoo.com",
|
||||
isActive: true,
|
||||
interval: 1000,
|
||||
createdAt: "2021-01",
|
||||
updatedAt: "2021-01",
|
||||
},
|
||||
];
|
||||
|
||||
const monitorsSlice = createSlice({
|
||||
name: "monitors",
|
||||
initialState,
|
||||
reducers: { setMonitors: (state, action) => action.payload },
|
||||
});
|
||||
|
||||
export const { setMonitors } = monitorsSlice.actions;
|
||||
|
||||
export default monitorsSlice.reducer;
|
||||
Reference in new issue
Block a user