avenger
avenger copied to clipboard
remove `invalidate` from `Product` and `Composition`
when a Product query is invalidated all the sub-queries that are part of it get invalidated too (ex const prod = product({ user, preferences }).invalidate() invalidates prod but also user and preferences). This makes it easy to mistakenly invalidate bigger chunks of data than actually needed and hides important details when invalidating (you only explicitly mention prod in the invalidation).
The same arguments applies to Composition as const comp = compose( user, preferences).invalidate() invalidates comp and also user and preferences.
The proposal is to leave invalidate only on CachedQuery and progressively mark it "deprecated" and then remove it from Product and Composition