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.
22 lines
520 B
22 lines
520 B
import * as c from '../constants';
|
|
|
|
const initialState = {
|
|
kanjis: [],
|
|
selectedKanji: null
|
|
}
|
|
|
|
// @ts-ignore
|
|
export default function kanjiReducer(state = initialState, action) {
|
|
switch (action.type) {
|
|
case c.FETCH_KANJIS:
|
|
// @ts-ignore
|
|
return { ...state, kanjis: state.kanjis.push(action.payload) };
|
|
case c.SET_SELECTED_KANJI:
|
|
// @ts-ignore
|
|
return { ...state, selectedKanji: action.payload };
|
|
default:
|
|
return state;
|
|
}
|
|
}
|
|
|