1.2.0 • Published 1 year ago

svelte-fetchable v1.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

svelte fetchable

npm i svelte-fetchable
<script>
  import fetchable from 'svelte-fetchable'

  const [resultFetch, loadingFetch] = fetchable.post('https://jsonplaceholder.typicode.com/posts')
</script>

<main>
 <div>
    {#if $loadingFetch}
      <span>loading...</span>
    {:else}
      <span>result: {JSON.stringify($resultFetch)}</span>
    {/if}

    <br />
    <button on:click={() => resultFetch.fetch({ username: 'John Doe' })}>Fetch</button>
    <br />
    <button on:click={resultFetch.abort}>Abort</button>
  </div>
</main>
1.2.0

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.0.0

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago

0.0.0

2 years ago