Finished chapter 12
This commit is contained in:
@@ -3,7 +3,6 @@
|
|||||||
import Reactotron from "reactotron-react-native";
|
import Reactotron from "reactotron-react-native";
|
||||||
import { reactotronRedux } from "reactotron-redux";
|
import { reactotronRedux } from "reactotron-redux";
|
||||||
|
|
||||||
//if (process.env.NODE_ENV === "development") {
|
|
||||||
const reactotron = Reactotron.configure({
|
const reactotron = Reactotron.configure({
|
||||||
port: 9090,
|
port: 9090,
|
||||||
host: "192.168.1.200"
|
host: "192.168.1.200"
|
||||||
@@ -13,15 +12,12 @@ const reactotron = Reactotron.configure({
|
|||||||
ignoreUrls: /\/logs$/
|
ignoreUrls: /\/logs$/
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
// .use(asyncStorage()) // FK: IS THIS NEEDED??
|
|
||||||
// .use(networking())
|
|
||||||
.use(
|
.use(
|
||||||
reactotronRedux({
|
reactotronRedux({
|
||||||
isActionImportant: action => action.type.includes("success")
|
isActionImportant: action => action.type.includes("success")
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
.connect();
|
.connect();
|
||||||
//}
|
|
||||||
|
|
||||||
Reactotron.log("A knick-knack is a thing that sits on top of a whatnot");
|
Reactotron.log("A knick-knack is a thing that sits on top of a whatnot");
|
||||||
Reactotron.warn("If you must make a noise, make it quietly");
|
Reactotron.warn("If you must make a noise, make it quietly");
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import { createStore, applyMiddleware } from "redux";
|
import { createStore, applyMiddleware } from "redux";
|
||||||
import thunk from "redux-thunk";
|
import thunk from "redux-thunk";
|
||||||
import { composeWithDevTools } from "redux-devtools-extension"; // decia remote-redux-devtools-sp
|
import { composeWithDevTools } from "redux-devtools-extension";
|
||||||
|
|
||||||
import { reducer } from "./world.reducer";
|
import { reducer } from "./world.reducer";
|
||||||
|
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ export const getCountries = () => async dispatch => {
|
|||||||
const result = await getCountriesAPI();
|
const result = await getCountriesAPI();
|
||||||
dispatch(countriesSuccess(result.data));
|
dispatch(countriesSuccess(result.data));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
console.error("getCountries: failure!");
|
||||||
dispatch(countriesFailure());
|
dispatch(countriesFailure());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -95,9 +96,11 @@ export const getRegions = (country: string) => async dispatch => {
|
|||||||
const result = await getRegionsAPI(country);
|
const result = await getRegionsAPI(country);
|
||||||
dispatch(regionsSuccess(result.data));
|
dispatch(regionsSuccess(result.data));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
console.error("getRegions: failure with API!");
|
||||||
dispatch(regionsFailure());
|
dispatch(regionsFailure());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
console.error("getRegions: failure, no country!");
|
||||||
dispatch(regionsFailure());
|
dispatch(regionsFailure());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user