First, always load data at the beginning of your functions, prior to modifying any state external to the function. For instance, if you are writing an element that takes a list and renders it in the web browser, load the list items you are going to display, as well as any fields on those items, prior to modifying the DOM. We recommend this because if any of the data is not yet ready, your code won't start making changes until all the data is loaded. Conversely, if you write your function so that it loads the first few list items, displays them, then loads some more items, you might end up accidentally displaying the first few items multiple times.