1.0.6 • Published 1 year ago

alpine-swr v1.0.6

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

SWR data fetching library for Alpine.js

This is basically port of SWRV library for Vue 3

Installation

  1. Install the library
npm i alpine-swr
  1. Register custom Alpine.js magic property
import swr from "alpine-swr";

Alpine.magic('swr', swr)

Usage

<div x-data="{todos: $swr('https://jsonplaceholder.typicode.com/todos')}">
    <p x-show="!todos.data">Loading...</p>
    <div x-show="todos.data">
        <template x-for="todo in todos.data" :key="todo.id">
            <p>Title: <span x-text="todo.title"></span></p>
        </template>
    </div>
</div>

TODO (For now you can refer to the original documentation swrv)

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago