-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
157ec17
commit 58fef5b
Showing
11 changed files
with
2,853 additions
and
28 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { TypedUseSelectorHook, useDispatch, useSelector } from "react-redux"; | ||
import { RootState, AppDispatch } from "../stores/store"; | ||
|
||
export const useAppDispatch: () => AppDispatch = useDispatch; | ||
export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector; |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { PayloadAction, createSlice } from "@reduxjs/toolkit"; | ||
import { RootState } from "../stores/store"; | ||
|
||
export interface ExecProfileObject | ||
{ | ||
ID: string; | ||
|
||
Name: string; | ||
|
||
ImageBuffer: string; | ||
|
||
Position: number; | ||
|
||
Description: string; | ||
} | ||
|
||
export interface ExecProfileState | ||
{ | ||
Profiles: ExecProfileObject[]; | ||
} | ||
|
||
const initialState: ExecProfileState = { | ||
Profiles: [] | ||
}; | ||
|
||
export const execProfileSlice = createSlice( | ||
{ | ||
name: "execProfile", | ||
initialState, | ||
reducers:{ | ||
AddExecProfile: (state, action: PayloadAction<ExecProfileObject>) => { | ||
return {...state, Profiles: [...state.Profiles, action.payload]}; | ||
} | ||
} | ||
}); | ||
|
||
export const {AddExecProfile} = execProfileSlice.actions; | ||
export const selectProfile = (state: RootState) => state.execProfiles.Profiles; | ||
export default execProfileSlice.reducer; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { configureStore } from "@reduxjs/toolkit"; | ||
import execProfileReducer from "../slices/execProfileSlice" | ||
|
||
export const store = configureStore({ | ||
reducer: { | ||
execProfiles: execProfileReducer | ||
} | ||
}); | ||
|
||
export type RootState = ReturnType<typeof store.getState>; | ||
export type AppDispatch = typeof store.dispatch; |
Oops, something went wrong.