Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@mascii
Copy link
Contributor

@mascii mascii commented Jan 30, 2022

The following is sample code using [email protected] and @vue/[email protected]:

<template>
  <div>{{ data }}</div>
</template>

<script lang="ts">
import { defineComponent } from '@vue/composition-api';
import useSWRV from 'swrv';

const fetcher = () => {
  console.count('fetcher');
  return Promise.reject(new Error('rejected!'));
};

export default defineComponent({
  name: 'App',
  setup() {
    const { data } = useSWRV('/api/v2/foo', fetcher, {
      errorRetryCount: 0,
    });

    return {
      data,
    };
  },
});
</script>

When you run the code above, you'll see the following in your browser's console:

fetcher: 1
fetcher: 2
fetcher: 3
fetcher: 4
fetcher: 5
fetcher: 6
fetcher: 7
fetcher: 8
fetcher: 9
fetcher: 10
fetcher: 11
fetcher: 12
fetcher: 13
fetcher: 14
fetcher: 15
fetcher: 16
fetcher: 17
fetcher: 18
fetcher: 19
fetcher: 20
...(endlessly)

@CLAassistant
Copy link

CLAassistant commented Jan 30, 2022

CLA assistant check
All committers have signed the CLA.

@darrenjennings darrenjennings merged commit 0808a6c into Kong:master Feb 2, 2022
darrenjennings pushed a commit that referenced this pull request Mar 12, 2022
darrenjennings pushed a commit that referenced this pull request Mar 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants