Search Reducer , search items from redux store
import { createSlice } from “@reduxjs/toolkit”; export const productSlice = createSlice({ name: ‘products’, initialState: [], reducers: { addProduct: (state, action) => { state.push(action.payload) console.log(state) }, deleteProduct: (state, action) => { // const {title} = action.payload; return state.filter(item => item.title !== action.payload) }, searchProduct: (state, action) => { if (!action.payload.trim()) { return state } else { […]