avenger
avenger copied to clipboard
Allow partial keys when invalidating cached query
Suppose we have a query
export const myQuery = compose(
product({ a: param<string>(), b: param<string>(), c: param<string>() }),
queryShallow(
({ a, b, c }) => ...do stuff... ,
available
)
);
And a command which invalidates it
export const myCommand = command(
(input: { a: string }) => ... ),
{ myQuery }
);
When we use the command we have to declare a combination of parameters a, b, c
for which the cached value is no longer valid.
But if we want to invalidate all the cached values associated with the all the keys which contains a
(something like a, *, *
) there is no way to do it.