We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Looking at the docs I see everything declared inside a .svelte file between script tags.
<script> import { persist, cookieStorage } from "@macfja/svelte-persistent-store" import { writable } from "svelte/store" const newsLetterSubscription = persist(writable(false), cookieStorage(), "newsletter") </script>
Does this mean I can't use a js files anymore to define storages , attach them to a svelte store and import them into a .svelte file ?
[ < 2.0 code] persistent.js file
import { persist, createIndexedDBStorage, createLocalStorage, createSessionStorage, createCookieStorage } from '@macfja/svelte-persistent-store'; import { writable } from 'svelte/store'; import { AES, enc } from 'crypto-js'; export const idb = (sKey, value) => { return persist(writable(value), createIndexedDBStorage(), sKey); }; export const local = (sKey, value) => { return persist(writable(value), createLocalStorage(), sKey); }; export const session = (sKey, value) => { return persist(writable(value), createSessionStorage(), sKey); }; export const cookie = (sKey, value) => { return persist(writable(value), createCookieStorage(), sKey); };
logic.js
import {local, idb} from './persistent.js' export const contacts = local('array-contacts', [] );
.svelte file
<script> import {contacts} from './logic.js' console.log($contacts) </script>
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Looking at the docs I see everything declared inside a .svelte file between script tags.
Does this mean I can't use a js files anymore to define storages , attach them to a svelte store and import them into a .svelte file ?
[ < 2.0 code]
persistent.js file
logic.js
.svelte file
The text was updated successfully, but these errors were encountered: