JohnL4 / Diaspora

Diaspora RPG tools
MIT License
0 stars 0 forks source link

Serializer(s) called way too many times #10

Open JohnL4 opened 8 years ago

JohnL4 commented 8 years ago

Really, we only need to call the serializer when the tab is clicked. Is this a job for routing?

JohnL4 commented 7 years ago

Since the addition of router config, we get called only when the "XML" tab is clicked, but then we still get called 2 or 3 times, when probably only once will do.

This is because we call serialization every time get() is called on the xml component, which occurs multiple times while processing a tab click. Probably has a lot to do with change detection and whatnot. So, we have to do cache invalidation, where multiple changes invalidate the cache, but we cache the results of the serialization and reuse them if nothing has changed.

Or we use Observables properly. Maybe StarSystem and Cluster should be Observables? Probably really just StartSystem needs to be, since Clusters can't be changed by the user.

See: