Commit 5fcc6a62 authored by Aron Fiechter's avatar Aron Fiechter
Browse files

Add selectRange to yearRangeSlice

parent 3bfd214b
......@@ -3,8 +3,8 @@ import { createSlice } from '@reduxjs/toolkit';
export const yearRangeSlice = createSlice({
name: 'yearRange',
initialState: {
start: 0,
end: 0,
start: 1000,
end: 9999,
years: [],
},
reducers: {
......@@ -26,8 +26,10 @@ export const yearRangeSlice = createSlice({
export const { setStart, setEnd, setYears } = yearRangeSlice.actions;
export const selectStart = (state) => state.yearRange.start;
export const selectEnd = (state) => state.yearRange.end;
export const selectYears = (state) => state.yearRange.years;
export const selectRange = (state) => ({
start: state.yearRange.start,
end: state.yearRange.end,
});
export default yearRangeSlice.reducer;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment