* 🐛 Set fetchStatus to idle when dehydrating
* ✅ Add a test case for ensuring fetchStatus is idle
* ✅ Update tests
* 🚨 Fix lint warnings
* ✅ Update fetchStatus when hydrating
* :okay_hand: Review updates
---------
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
* perf(persist): subscriber calls persistQueryClientStore only on cache related events
* refactor(persist): extract NotifyEvent type shared between query and mutation cache
* refactor(persist): move cacheableEventTypes declaration outside the function
* test(persist): add test checking `persistClient` calls frequency
---------
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
* docs: example: algolia
* fix: remove empty line if desc is null
* fix: stale time value
* refactor: use vite and examples structure
* fix: remove deprecated doc files
* docs: add algolia example in the config.json
* fix: make sure pausedMutations always execute in serial
when resumePausedMutations is called multiple times, we are starting the second paused mutation even though the first one has not yet finished. This can happen when a focus event and an online event happen in short succession
* fix: always return the same Promise when resumePausedMutations is called
* fix: make sure every call to resumePausedMutations is evaluated
mutation.continue() needs to immediately resolve back if we didn't really continue so that consecutive calls to resumePausedMutations can be appended to the promise chain
* fix: types
* fix: make sure pausedMutations always execute in serial
when resumePausedMutations is called multiple times, we are starting the second paused mutation even though the first one has not yet finished. This can happen when a focus event and an online event happen in short succession
* fix: always return the same Promise when resumePausedMutations is called
* fix(core): make sure queries that never fetched can ge garbage collected
This is important if data comes into the cache via a non-fetching method (like setQueryData or hydration) AND there is no active observer for them. Without this, they would never be gc'ed, but they should be after the default cacheTime
* tests: simplify svelte test
* test: add mutation callback after unmount test
* test: make test more resilient
* fix(core): do not call mutate callbacks if mutation started after unmount
* test: adapt tests to what we have in v5
- one test has been removed (because setState was removed entirely)
- the second test has been re-written to not use internals anymore, and it works in v4 as well
* fix(core): do not call mutate callbacks if mutation started after unmount
by making sure the callbacks are only invoked if we have an active listener
* chore: prettier again
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>