Skip to content

Commit

Permalink
add reducer comments
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Ohlsen <[email protected]>
  • Loading branch information
ohltyler committed Apr 2, 2024
1 parent 400a4dd commit 854b4da
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions public/store/reducers/models_reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,19 @@ const modelsSlice = createSlice({
reducers: {},
extraReducers: (builder) => {
builder
// Pending states: set state consistently across all actions
// Pending states
.addCase(searchModels.pending, (state, action) => {
state.loading = true;
state.errorMessage = '';
})

// Fulfilled states
.addCase(searchModels.fulfilled, (state, action) => {
const { models } = action.payload as { models: ModelDict };
state.models = models;
state.loading = false;
state.errorMessage = '';
})

// Rejected states
.addCase(searchModels.rejected, (state, action) => {
state.errorMessage = action.payload as string;
state.loading = false;
Expand Down

0 comments on commit 854b4da

Please sign in to comment.