You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
590 B
23 lines
590 B
import { initKanjiListByGrade } from '../../model/kanjiListByGrades';
|
|
import * as c from '../constants';
|
|
|
|
const initialState = {
|
|
kanjis: initKanjiListByGrade(),
|
|
selectedKanji: null,
|
|
}
|
|
|
|
// @ts-ignore
|
|
export default function kanjiReducer(state = initialState, action) {
|
|
switch (action.type) {
|
|
case c.SET_KANJIS:
|
|
// @ts-ignore
|
|
return { ...state, kanjis: action.payload };
|
|
case c.SET_SELECTED_KANJI:
|
|
// @ts-ignore
|
|
return { ...state, selectedKanji: action.payload };
|
|
default:
|
|
return state;
|
|
}
|
|
}
|
|
|