In Instagram (web), when you click back/forward arrows - I've noticed that the content isn't loaded from the server and it immediately show up. After reading the docs on react.js + flux, I had this understanding:
Action -> Dispatcher -> Stores ...
where the stores
would listen for changes and load new data from server in an array e.g: {"data": post_id: 10}
I really want to achieve this, since right now I'm loading content using ajax + push state
(window.onpopstate = history.onpushstate = function() { ...... }
).
And the problem with using this, is that all content loaded on scroll (e.g: posts) are lost during navigation. And when you return back, you start from beginning, so you have to scroll to the point you stopped at last time. I noticed this problem on Facebook website, yet not in Instagram...
So my questions are:
- Does the immediate response comes from stores? If so in what format and how?
- Is react.js the only way to achieve this, maybe using backbone or angular?
- Why Facebook website doesn't use this and Instagram does?
Please give me some examples (code) or links, since I'm new to this..Thanks