initial version random-quote-machine

This commit is contained in:
2020-04-02 01:21:47 -07:00
parent 5b48f673c4
commit 5fba3f09d7
45 changed files with 713 additions and 149 deletions

View File

@@ -0,0 +1,13 @@
import { REQUESTING_QUOTE } from "../actions/quoteFetchActionCreator";
import { RECEIVED_QUOTE } from "../actions/quoteFetchActionCreator";
export default (state = { fetching: false, quote: "" }, action) => {
switch (action.type) {
case REQUESTING_QUOTE:
return { fetching: true, quote: "" };
case RECEIVED_QUOTE:
return { fetching: false, quote: action.newQuote };
default:
return state;
}
};

View File

@@ -0,0 +1,10 @@
import { INCCOLORCOUNT } from "../actions/colorCounterAction";
export default (state = 1, action) => {
switch (action.type) {
case INCCOLORCOUNT:
return action.count;
default:
return state;
}
};

View File

@@ -0,0 +1,8 @@
import { combineReducers } from "redux";
import colorCounterReducer from "./colorCounterReducer";
import asyncQuoteReducer from "./asyncQuoteReducer";
export default combineReducers({
colorCount: colorCounterReducer,
newQuote: asyncQuoteReducer,
});