ISSUE-045 - Chyron Body - Taking a moment to rename some reducers to be more consistant (verb in front).
This commit is contained in:
1 parent
dbab285578
commit
fd18703d1a
5 files changed
+28
-28
No files matched your search
@@ -13,16 +13,16 @@ export const broadcastDirectorSlice = createSlice({
|
||||
name: "broadcastDirector",
|
||||
initialState,
|
||||
reducers: {
|
||||
selectedCarsAdd: (state, action: PayloadAction<Car>) => {
|
||||
pushSelectedCars: (state, action: PayloadAction<Car>) => {
|
||||
const index = findIndex(state.selectedCars, carMatch(action.payload));
|
||||
if (index === -1) {
|
||||
state.selectedCars = state.selectedCars.concat(action.payload);
|
||||
}
|
||||
},
|
||||
selectedCarsSet: (state, action: PayloadAction<Car>) => { // Might be removed.
|
||||
setSelectedCars: (state, action: PayloadAction<Car>) => { // Might be removed.
|
||||
state.selectedCars = [action.payload];
|
||||
},
|
||||
selectedCarsRemove: (state, action: PayloadAction<Car | number>) => {
|
||||
removeSelectedCars: (state, action: PayloadAction<Car | number>) => {
|
||||
const index = typeof action.payload === "number"
|
||||
? action.payload
|
||||
: findIndex(state.selectedCars, carMatch(action.payload));
|
||||
@@ -36,7 +36,7 @@ export const broadcastDirectorSlice = createSlice({
|
||||
* car.
|
||||
* @param action Car (optional)
|
||||
*/
|
||||
selectedCarsClear: (state, action: PayloadAction<Optional<Car>>) => {
|
||||
clearSelectedCars: (state, action: PayloadAction<Optional<Car>>) => {
|
||||
if (action.payload == null) {
|
||||
state.selectedCars = [];
|
||||
} else {
|
||||
@@ -47,9 +47,9 @@ export const broadcastDirectorSlice = createSlice({
|
||||
});
|
||||
|
||||
export const {
|
||||
selectedCarsAdd,
|
||||
selectedCarsSet,
|
||||
selectedCarsRemove,
|
||||
selectedCarsClear,
|
||||
pushSelectedCars,
|
||||
setSelectedCars,
|
||||
removeSelectedCars,
|
||||
clearSelectedCars,
|
||||
} = broadcastDirectorSlice.actions;
|
||||
export default broadcastDirectorSlice.reducer;
|
||||
@@ -10,10 +10,10 @@ export const broadcastGraphicsSlice = createSlice({
|
||||
name: "broadcastGraphics",
|
||||
initialState,
|
||||
reducers: {
|
||||
chyronsSet: (state, action: PayloadAction<BGChyrons>) => {
|
||||
setChyrons: (state, action: PayloadAction<BGChyrons>) => {
|
||||
state.chyrons = action.payload;
|
||||
},
|
||||
chyronsOpenStateSet: (state, action: PayloadAction<OpenState>) => {
|
||||
setChyronsOpenState: (state, action: PayloadAction<OpenState>) => {
|
||||
if (state.chyrons == null) return;
|
||||
state.chyrons.openState = action.payload;
|
||||
|
||||
@@ -21,7 +21,7 @@ export const broadcastGraphicsSlice = createSlice({
|
||||
state.chyrons.openState = action.payload;
|
||||
}
|
||||
},
|
||||
chyronsOpenStateIncrement: (state) => {
|
||||
incrementChyronsOpenState: (state) => {
|
||||
if (state.chyrons == null) return;
|
||||
++state.chyrons.openState;
|
||||
|
||||
@@ -29,16 +29,16 @@ export const broadcastGraphicsSlice = createSlice({
|
||||
++state.chyrons.openState;
|
||||
}
|
||||
},
|
||||
chyronsClear: (state) => {
|
||||
clearChyrons: (state) => {
|
||||
state.chyrons = null;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export const {
|
||||
chyronsSet,
|
||||
chyronsOpenStateSet,
|
||||
chyronsOpenStateIncrement,
|
||||
chyronsClear,
|
||||
setChyrons,
|
||||
setChyronsOpenState,
|
||||
incrementChyronsOpenState,
|
||||
clearChyrons,
|
||||
} = broadcastGraphicsSlice.actions;
|
||||
export default broadcastGraphicsSlice.reducer;
|
||||
@@ -46,13 +46,13 @@ export const eventSlice = createSlice({
|
||||
name: "event",
|
||||
initialState,
|
||||
reducers: {
|
||||
courseFlagSet: (state, action: PayloadAction<CourseFlag>) => {
|
||||
setCourseFlag: (state, action: PayloadAction<CourseFlag>) => {
|
||||
state.courseStatus.courseFlag = action.payload;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export const {
|
||||
courseFlagSet,
|
||||
setCourseFlag,
|
||||
} = eventSlice.actions;
|
||||
export default eventSlice.reducer;
|
||||
Reference in new issue
Block a user