Changeset View
Changeset View
Standalone View
Standalone View
web/redux/community-picker-reducer.js
- This file was added.
// @flow | |||||
import { | |||||
updateCalendarCommunityFilter, | |||||
clearCalendarCommunityFilter, | |||||
} from 'lib/actions/community-actions.js'; | |||||
import type { Action, CommunityPickerStore } from './redux-setup'; | |||||
export function reduceCommunityPickerStore( | |||||
communityPickerStore: CommunityPickerStore, | |||||
action: Action, | |||||
): CommunityPickerStore { | |||||
if (action.type === updateCalendarCommunityFilter) { | |||||
return { | |||||
...communityPickerStore, | |||||
calendar: action.payload, | |||||
}; | |||||
} else if (action.type === clearCalendarCommunityFilter) { | |||||
return { | |||||
...communityPickerStore, | |||||
calendar: null, | |||||
}; | |||||
} | |||||
return communityPickerStore; | |||||
} |