We're a place where coders share, stay up-to-date and grow their careers.
I think the use of JSON.parse(JSON.stringify(object)); might be very slow.
Kind regards, Tailor
I've yet to see a performance hit with it in production environments running on older mobile devices :)
When it comes to Firebase apps, this will probably slow down your data fetching by hundreds of milliseconds, which, in many cases, is a lot for synchronized experiences developed with this type of database.
Perhaps it would be faster to spread the typed object into a new object:
{...entity}
What problem are you trying to solve with that? Why not just put the object directly into firebase?
I think the use of JSON.parse(JSON.stringify(object)); might be very slow.
Kind regards,
Tailor
I've yet to see a performance hit with it in production environments running on older mobile devices :)
When it comes to Firebase apps, this will probably slow down your data fetching by hundreds of milliseconds, which, in many cases, is a lot for synchronized experiences developed with this type of database.
Perhaps it would be faster to spread the typed object into a new object:
{...entity}
What problem are you trying to solve with that? Why not just put the object directly into firebase?