The only thing that bothers me a bit is the fact that the dehydrated result contains a lot of extra data, and requires this extra data to hydrate it, forcing you to use hydration-next for both hydrating and dehydrating. I see an issue with this, what if the data comes from an api that does not return that extra data. How would it be handled in that case?
Interesting solution!
The only thing that bothers me a bit is the fact that the dehydrated result contains a lot of extra data, and requires this extra data to hydrate it, forcing you to use hydration-next for both hydrating and dehydrating. I see an issue with this, what if the data comes from an api that does not return that extra data. How would it be handled in that case?
If there is no
_types
field, the original object is returned, so it will work same asJSON.parse
.