pixiv.moe
Version:
A pinterest-style layout site, shows illusts on [pixiv.net](http://pixiv.net) order by popularity. Written with React.
30 lines (25 loc) • 553 B
text/typescript
import * as LocaleActions from '@/actions/locale';
import { ILocaleAction } from '@/actions/locale';
const types = LocaleActions.types;
export interface ILocaleState {
lang: string;
messages: any;
}
export default function locale(
state: ILocaleState = {
lang: '',
messages: {}
},
action: ILocaleAction
): ILocaleState {
switch (action.type) {
case types.SET_LOCALE:
return {
...state,
lang: action.payload.lang,
messages: action.payload.messages
};
default:
return state;
}
}