June 2016
Intermediate to advanced
910 pages
18h 59m
English
The appConfig module keeps application-level configuration details all in one place.
File: js/appConfig.js
export default {
pageSize: 10,
apiRoot: '//localhost:3000',
postSummaryLength: 512,
loadTimeSimMs: 2000
};At this point in development, only the apiRoot is needed. The other items you see in the source will be used later. The pageSize variable is for the infinite scroll feature we'll implement in Chapter 7, React Blog App Part 4 – Infinite Scroll and Search. The postSummaryLength member is for the summary post descriptions, which appear in post lists in the next chapter. Finally, the loadTimeSimMs is an artificial delay we'll use to get a sense of how the application would feel with non-trivial server communication ...
Read now
Unlock full access