DEV Community

loading...

Discussion on: Building a Firebase CRUD Service for Angular

Collapse
tailorvj profile image
Tailor Vijay

I think the use of JSON.parse(JSON.stringify(object)); might be very slow.

Kind regards,
Tailor

Collapse
coly010 profile image
Colum Ferry Author

I've yet to see a performance hit with it in production environments running on older mobile devices :)

Collapse
tailorvj profile image
Tailor Vijay

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.

Thread Thread
coly010 profile image
Colum Ferry Author

Perhaps it would be faster to spread the typed object into a new object:

{...entity}

Thread Thread
dylanwatsonsoftware profile image
Dylan Watson

What problem are you trying to solve with that? Why not just put the object directly into firebase?