Swr: missing revalidate in documentation

Created on 11 Mar 2020  路  2Comments  路  Source: vercel/swr

I am using revalidate as value returning from useSWR but I don't find it in the doc.

Also here there is an example of revalidate: https://github.com/zeit/swr/blob/master/examples/refetch-interval/pages/index.js

It could be useful adding that to the README

Most helpful comment

Revalidate is going to be deprecated, mutate does the same if you don't pass any argument.

All 2 comments

Revalidate is going to be deprecated, mutate does the same if you don't pass any argument.

I wonder why this decision was made at an API surface level ? Calling mutate() seems to me like a hidden gem that is hard to discover by somebody that doesn't know the library. Also, I believe that aliasing this call via revalidate is cheap to maintain.

What were your thoughts around it @sergiodxa @shuding ?

Was this page helpful?
0 / 5 - 0 ratings