Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/markmead/alpinejs-persist-extended

Extends the official `$persist` plugin to help you work with `localStorage` 📦
https://github.com/markmead/alpinejs-persist-extended

alpine-js alpinejs alpinejs-persist alpinejs-plugin javascript javascript-localstorage localstorage

Last synced: 3 months ago
JSON representation

Extends the official `$persist` plugin to help you work with `localStorage` 📦

Awesome Lists containing this project

README

        

# Alpine JS Persist Extended

Extends the official `$persist` plugin to help you work with `localStorage` 📦

## Install

### With a CDN

```html

```

### With a Package Manager

```shell
npm i -D alpinejs-persist-extended

yarn add -D alpinejs-persist-extended
```

```js
import Alpine from 'alpinejs'
import storage from 'alpinejs-persist-extended'

Alpine.plugin(storage)

window.Alpine = Alpine

Alpine.start()
```

## Example

```html


Alert Name

Delete Name


```

### Get

```js
$persistGet('fullName')
```

Gets the value from `localStorage` of the provided key.

### Delete

```js
$persistDelete('fullName')
```

Deletes the data from `localStorage`, it also emits an event that you can listen
for in Alpine JS.

```html


```

### Stats

![](https://img.shields.io/bundlephobia/min/alpinejs-persist-extended)
![](https://img.shields.io/npm/v/alpinejs-persist-extended)
![](https://img.shields.io/npm/dt/alpinejs-persist-extended)
![](https://img.shields.io/github/license/markmead/alpinejs-persist-extended)