Skip to content
forked from Kong/swrv

Stale-while-revalidate data fetching for Vue

License

Notifications You must be signed in to change notification settings

nahinakbar/swrv

Repository files navigation

swrv

@vue/composition-api hooks for remote data fetching.

$ yarn add swrv

Getting Started

<template>
  <div v-if="error">failed to load</div>
  <div v-if="!data">loading...</div>
  <div v-else>hello {{data.name}}</div>
</template>

<script>
import useSWR from 'swrv'

export default {
  name: 'Profile',

  setup() {
    return useSWR('/api/user', fetcher)
  }
}
</script>

About

Stale-while-revalidate data fetching for Vue

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 95.4%
  • JavaScript 4.0%
  • Shell 0.6%