Skip to content

Conversation

@cernymatej
Copy link

@cernymatej cernymatej commented Jan 17, 2024

I wanted to use dynamic imports in revivers to make them more generic. However, the current implementation doesn't allow this because the parsed value would be a promise.
This PR introduces asynchronous versions of unflatten and parse, enabling this functionality. I updated the tests accordingly.

Initially, I considered extracting parts of the hydrate function into separate functions for reuse in the async version, however, after some thinking I decided against it due to potential performance issues. I think it's best if we call as few functions as possible here - since it's a recursive call chain.

Feedback welcome!

@Vanilagy
Copy link

Vanilagy commented Jul 4, 2024

This is lovely, I need exactly this!

@Stadly
Copy link

Stadly commented Dec 11, 2024

I also need this! But also for stringify.

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.

3 participants