Skip to content
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

Synchronous fromJSON in hal #471

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

remidewitte
Copy link

Context :

  1. We are using Ketting in a Next.js application.
  2. We do some data fetching using in getStaticProps, where props needs to be serializable. HalState is not as is.
  3. We want to to convert a json in injected props by Next to synchronously populate the cache before rendering, so we need fromJSON to be sync (factory is async because of await response.json()).

We don't really need the changes in base-state.ts and interface.ts.

@remidewitte
Copy link
Author

Ping @qmachard .

@remidewitte
Copy link
Author

Hi @evert !

Do you have an opinion on this one ? Or do you prefer #472 ?

Use case is similar to what's described here : https://tanstack.com/query/v4/docs/react/guides/ssr

Cheers,
Rémi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant