mirror of
https://github.com/aleleba/create-react-ssr.git
synced 2025-04-19 22:28:06 -06:00
23 lines
383 B
TypeScript
23 lines
383 B
TypeScript
export interface ITestReducer {
|
|
hello: any | undefined
|
|
}
|
|
|
|
const initialState = {
|
|
hello: 'world'
|
|
};
|
|
|
|
let testReducer = (state = initialState, action: { type: any; payload: { hello: any; }; }) => {
|
|
switch (action.type){
|
|
case 'CHANGE_HELLO': {
|
|
let newHello = action.payload.hello;
|
|
return {
|
|
hello: newHello
|
|
};
|
|
}
|
|
default:
|
|
return state;
|
|
}
|
|
};
|
|
|
|
export default testReducer;
|