Skip to content

Tags: nahinakbar/swrv

Tags

v0.7.0

Toggle v0.7.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
fix(ttl) TTL issue in mutate function (Kong#56)

* feat(mutate) enhance mutate function
* refactor(revalidate) rename revalidate mutate
* fix(cache): fix issue when ttl was set to 0
* test(ttl): add ttl test cases

Fixes Kong#56 Kong#28

v0.6.0

Toggle v0.6.0's commit message
chore(release) 0.6.0

v0.5.1

Toggle v0.5.1's commit message
chore(release) 0.5.1

v0.5.0

Toggle v0.5.0's commit message
docs(readme) add entry to toc

v0.4.0

Toggle v0.4.0's commit message
chore(release) 0.4.0

v1.0.0-beta.1

Toggle v1.0.0-beta.1's commit message
docs(example) add vite readme

v0.3.2

Toggle v0.3.2's commit message
chore(*) release 0.3.2

v0.3.1

Toggle v0.3.1's commit message
chore(*) release 0.3.1

v0.3.0

Toggle v0.3.0's commit message
chore(*) release 0.3.0

v0.2.0

Toggle v0.2.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
feat(revalidation) add revalidation in mutate (Kong#17)

mutate was only warming the DATA_CACHE and was not triggering revalidations on
all swrv instances, so a user could not easily inject data via some async event
outside of the context of a useSWRV hook e.g. via websocket event. This adds all
the stateRefs into a cache (essentially a Map wrapper) that allows mutate to
access the vue reactivity when setting data/error/etc. Since each item in
REF_CACHE is reactive, setting their values will trigger rerenders in each
useSWRV instance.

This introduces a small change to existing functionality that if the fetcherFn
is a simple function that resolves immediately e.g. () => 'hello', then the data
 ref will never be undefined, but will be hello on first render.

Fixes Kong#16