I'm new to Redux and started with ngrx. I'm unable to understand the concept of the store and his purpose.
Say I have book store application. I can buy or sell books to users.
I using ngrx to fetch the books list I have using this action: LOAD_BOOKS, then I using effects to load from http the list of books and save it back to the store.
When I entered to /books, before loading the component I have guard. in this guard I check if the book list is in the store (if not I send LOAD_BOOKS action) and after the list is loaded I render the component that display all the books (from the store)
next time when I entered to /books again, the list is in the Store.
So I understand that I do not need to call my http to bring me this list because I have this list in the store.
But, what happened if somebody else buy one of the books? my list of available books from the store is not updated.
I never got to update because it is already in the store.
So my question is how should I handle this scenario? what to store and what not? what is the purpose of this store if not to store data. the problem is what to do when the data change inside the server? I working on "offline" data