mirror of
https://github.com/TrentSPalmer/fcc-challenges.git
synced 2026-11-09 18:35:09 -08:00
initial version random-quote-machine
This commit is contained in:
1 parent
5b48f673c4
commit
5fba3f09d7
45 files changed
+713
-149
No files matched your search
@@ -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;
|
||||
}
|
||||
};
|
||||
@@ -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;
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,8 @@
|
||||
import { combineReducers } from "redux";
|
||||
import colorCounterReducer from "./colorCounterReducer";
|
||||
import asyncQuoteReducer from "./asyncQuoteReducer";
|
||||
|
||||
export default combineReducers({
|
||||
colorCount: colorCounterReducer,
|
||||
newQuote: asyncQuoteReducer,
|
||||
});
|
||||
Reference in new issue
Block a user