NerdWalletOSS / apollo-cache-policies

An extension of the Apollo 3 cache with support for advanced cache policies.
Apache License 2.0
152 stars 22 forks source link

add support for default policy actions on any type write/evict #15

Closed danReynolds closed 3 years ago

danReynolds commented 3 years ago

It can be the case that a user might need to specify a policy action for when a particular type is written/evicted in order to perform a side-effect, but that side-effect is not tied to any particular type. For example, a user might want to log out any time a particular entity is changed and not care about binding the parent event to any particular child event.

This feature adds support for a __default type event that can be used to perform arbitrary side effects.