Skip to content

Commit 85007c0

Browse files
committed
[Fix][Slice]Return setLoading
1 parent 76b7efd commit 85007c0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/redux/neurojson/neurojson.slice.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,11 @@ const neurojsonSlice = createSlice({
2929
state.loading = false;
3030
state.hasMore = true; // Reset pagination availability
3131
},
32+
setLoading: (state, action: PayloadAction<boolean>) => {
33+
state.loading = action.payload;
34+
},
3235
},
3336
extraReducers: (builder) => {
34-
// Handle paginated data loading
3537
builder
3638
.addCase(loadPaginatedData.pending, (state) => {
3739
state.loading = true;
@@ -98,6 +100,6 @@ const neurojsonSlice = createSlice({
98100
},
99101
});
100102

101-
export const { resetData } = neurojsonSlice.actions;
103+
export const { resetData, setLoading } = neurojsonSlice.actions;
102104

103105
export default neurojsonSlice.reducer;

0 commit comments

Comments
 (0)