@pinia/colada
Advanced tools
Changelog
0.12.0 (2024-11-06)
transformError
was never fully implemented so they are being removed and might come back if they is a real-word use case for themdelayLoadingRef
util, use the @pinia/colada-plugin-delay
instead.Error
to defaultError
allows to differentiate the property from the existing global Error class. Upgrading should be straightforward.Changelog
0.11.0 (2024-10-25)
useQueryCache()
outside. It could be added back if needed but it's
more pragmatic to start without it.queryCache.cancelQuery()
is renamed to
queryCache.cancel()
to better match the other functions naming. A new
function queryCache.cancelQueries()
is added to actually cancel one or
multiple queries instead of just one.cache
is renamed to queryCache
for
consistency.queryCache
is the result
of useQueryCache()
.Changelog
0.10.0 (2024-10-04)
useMutation()
hooks now uses positional arguments. This change is mainly to simplify migration from TanStack Query.caches.invalidateQueries()
only fetches active querieskeys
option that automatically invalidate keys
has been renamed to invalidateKeys
and moved to a plugin. This is in
practice not needed. It's just an opinionated convenience that can be
replaced by directly invalidating queries in the cache with the
onSettled()
hook in useMutation()
:const { mutate } = useMutation({
onSettled({ caches, vars: { id } }) {
caches.invalidateQueries({ key: ['contacts-search'] })
caches.invalidateQueries({ key: ['contacts', id] })
},
mutation: (contact) => patchContact(contact),
})