This repository has been archived by the owner on Mar 15, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #146 from ryangjchandler/feature/store-specific-dr…
…ivers feature: store specific drivers
- Loading branch information
Showing
5 changed files
with
702 additions
and
639 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<html> | ||
<head> | ||
<script src="https://cdn.jsdelivr.net/gh/alpinejs/[email protected]/dist/alpine.js" defer></script> | ||
</head> | ||
<body> | ||
<div x-data> | ||
<p>This store uses the `localStorage` driver for persistence.</p> | ||
<p>Toggle the checkbox and see the data persist to the next page load.</p> | ||
<input type="checkbox" x-model="$store.localStorage.checked"> | ||
</div> | ||
|
||
<div x-data> | ||
<p>This store uses the `sessionStorage` driver for persistence.</p> | ||
<p>Toggle the checkbox and see the data persist to the next page load.</p> | ||
<input type="checkbox" x-model="$store.sessionStorage.checked"> | ||
</div> | ||
|
||
<script src="/dist/spruce.umd.js"></script> | ||
|
||
<script> | ||
Spruce.store('localStorage', { | ||
checked: false, | ||
}, true) | ||
|
||
Spruce.store('sessionStorage', { | ||
checked: false, | ||
}, window.sessionStorage) | ||
</script> | ||
</body> | ||
</html> |
Oops, something went wrong.