Skip to content

Check if key exists? #498

Answered by huozhi
raj-altrio asked this question in General
Jul 2, 2020 · 2 comments · 1 reply
Discussion options

You must be logged in to vote

@raj-altrio hope cache.has(key) api is the thing you're looking for

import {cache} from 'swr'

cache.set(key, value)
cache.has(key) // return true

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@raj-altrio
Comment options

Answer selected by raj-altrio
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants