I am developing a website using my opinion. This error appears and I do not know how to solve it
Expected an assignment or function call and instead saw an expression no-unused-expressions
it is appears in extraReducers section
my code :
const bookSlice = createSlice({
name: 'book',
initialState: { books: [], isLoading: false, error: null, book: null },
reducers: {},
extraReducers: (builder) => {
//GET BOOKS
builder.addCase(getBooks.pending, (state) => {
state.isLoading = true;
state.error = null;
}),
builder.addCase(getBooks.fulfilled, (state, action) => {
state.isLoading = false;
state.books = action.payload;
}),
builder.addCase(getBooks.rejected, (state, action) => {
state.isLoading = false;
state.error = action.payload;
}),
// INSERT BOOK
builder.addCase(insertBook.pending, (state) => {
state.isLoading = true;
state.error = null;
}),
builder.addCase(insertBook.fulfilled, (state, action) => {
state.isLoading = false;
state.books.push(action.payload);
}),
builder.addCase(insertBook.rejected, (state, action) => {
state.isLoading = false;
state.error = action.payload;
});
},
});
how to solve that error ?