import { produce } from "immer";
import { SearchActions } from "../actions/searchActions";
export const initialState = {
    searchQuery: "",
    searchResults: [],
};
export const searchReducer = produce((state, action) => {
    SearchActions.match(action, {
        /**
         */
        UPDATE_QUERY: (query) => {
            state.searchQuery = query;
        },
        /**
         */
        UPDATE_RESULTS: (results) => {
            state.searchResults = results;
        },
        /**
         */
        RESET_SEARCH: () => {
            state.searchResults = [];
            state.searchQuery = "";
        },
        default: () => state,
    });
}, initialState);
//# sourceMappingURL=searchReducer.js.map