-
Notifications
You must be signed in to change notification settings - Fork 0
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
SSR support #16
Labels
Comments
Should provide a way to create new state in server to prevent from mutating the global model's state directly in server. It would cause state pollution. |
This was referenced Jul 3, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
My current idea is to hydrate based on different accessors. The API might look like this:
The
useHydrate
function will record the provided accessor and execute the function if the current accessor hasn't been recorded yet. When the accessor changes, it removes the previously recorded one and records the new one. In the example above, this ensures that whenpost
changes, we can update the model in real-time.However, this approach has a drawback. Developers need to place
useHydrate
at the top level of the component tree to manage accessors centrally and avoid duplicate accessors being passed. Additionally, attention needs to be paid to which models need to be hydrated on which pages to prevent data from being missed.The text was updated successfully, but these errors were encountered: