saveState method saves all state changes until on server
loadState method checks if saved state exists and if so loads it and merges onto the store and sets dataRestoredFromSSR to true. After we listen to page finish loading event in order to set dataRestoredFromSSR back to false.
dataRestoredFromSSR allows us to prevent all http calls until page is loaded - meaning that we will not hit server with repetetive requests for data that has been already loaded and restored.
Our http requests might look like this
this.http.post(url, body).pipe(
withLatestFrom(this.store.map((s) => s.dataRestoredFromSSR)),
filter(([_, dataRestoredFromSSR]) => !dataRestoredFromSSR),
map(([response, _]) => response),
//do the rest like .subscribe
)