-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I need help ! #78
Comments
The idea is to only include app level data in the initial SSR response. For example, the data needed to build the main menu and navigational tabs. These generally don't change and thus including this data with every subsequent API response just slows things down and uses more network bandwidth. The
React Storefront is meant to be deployed on top of a headless ecommerce platform like Shopify or CommerceTools that provides the catalog, payment processing, and cart persistence for you. Those platforms typically store the user session in a database.
App data is always provided during server side rendering and generally not updated thereafter. See my answer to 2.
You make a good point here - there should be a way to update session data in general. Let us think on this and figure out what changes should be made. |
Hi !
I am newbie with this project and I have few question want to ask:
What is the usage of the the api/session ? I know it can pass down the session data through the child but we can also do that with appData. Another thing is how I can update and get back session data for each user. Do I need use redis or any db to store the session and get session data back based on the id which I will set to user cookie ?
What is the usage of useAppStore hook ? in pages/_app.js why don use appData direct from pageProps ? Why _app don use createLazyProps like another pages ?
I want to make simple app like the shopping cart ? But I want to make the cart persistent, do I need to store using db when add to cart and in api/cart I will get the cart details out of db. ?
What is the usage of appData ? I can see that for the Server side rendering, the appData handler will be call in fullfillRequestAPI but I wonder how I can set the appData when I am in one specific page which is render on client side.
About the SessionContext, there is only one action is updateCartCount and it will update only in context, so how can I add more actions for session Context. Maybe I would like to have action to add product or logged user into session ?
The text was updated successfully, but these errors were encountered: