forge42dev / remix-client-cache

Utility library to cache your client data in Remix.run
MIT License
150 stars 2 forks source link

InvalidCache with wildcards #2

Open FKSI opened 6 months ago

FKSI commented 6 months ago

If an user goes to /books and perform a query to /books?query="harry potter" both are cached. If user add to its favorites the book from the query. Then we need to invalidate both routes.

Since /books displays the favorites at the top.

It would be great to be able to invalidate the cache from a wildcard such as invalidateCache("/books*")

Great job btw!

AlemTuzlak commented 6 months ago

@FKSI Thank you! Will try to add this in the near future

FKSI commented 6 months ago

In the meantime I found a way to make a wildcard system: