UNPKG

e-lado

Version:

[![CircleCI](https://circleci.com/gh/sharetribe/sharetribe/tree/master.svg?style=svg)](https://circleci.com/gh/sharetribe/sharetribe/tree/master) [![Dependency Status](https://gemnasium.com/sharetribe/sharetribe.png)](https://gemnasium.com/sharetribe/shar

22 lines (17 loc) 634 B
import * as actionTypes from '../constants/SearchPageConstants'; import { SearchPageModel } from '../components/sections/SearchPage/SearchPage'; // prevPage, currentPage, and nextPage are Id lists const initialState = { searchPage: new SearchPageModel(), }; export default function searchPageReducer(state = initialState, action) { const { type, payload } = action; switch (type) { case actionTypes.CURRENT_PAGE_UPDATE: return state .set('currentPage', payload.currentPage) .set('listings', state.get('listings').union(payload.listings.toSet())); default: return state; } }