1
0
mirror of https://github.com/NickKaramoff/toot synced 2025-06-05 21:59:33 +02:00

Update nanostores

This commit is contained in:
Nikita Karamov
2024-09-13 10:49:25 +02:00
parent c759eb0858
commit b1181d4748
3 changed files with 23 additions and 21 deletions

View File

@@ -37,9 +37,9 @@
"@astrojs/netlify": "^5.5.2",
"@astrojs/node": "^8.3.3",
"@astrojs/vercel": "^7.8.1",
"@nanostores/persistent": "^0.9.1",
"@nanostores/persistent": "^0.10.2",
"astro": "^4.15.4",
"nanostores": "^0.9.5"
"nanostores": "^0.11.3"
},
"devDependencies": {
"@astrojs/check": "^0.9.3",

28
pnpm-lock.yaml generated
View File

@@ -24,14 +24,14 @@ importers:
specifier: ^7.8.1
version: 7.8.1(astro@4.15.4(@types/node@18.19.50)(lightningcss@1.27.0)(rollup@4.21.3)(sass@1.78.0)(typescript@5.6.2))
'@nanostores/persistent':
specifier: ^0.9.1
version: 0.9.1(nanostores@0.9.5)
specifier: ^0.10.2
version: 0.10.2(nanostores@0.11.3)
astro:
specifier: ^4.15.4
version: 4.15.4(@types/node@18.19.50)(lightningcss@1.27.0)(rollup@4.21.3)(sass@1.78.0)(typescript@5.6.2)
nanostores:
specifier: ^0.9.5
version: 0.9.5
specifier: ^0.11.3
version: 0.11.3
devDependencies:
'@astrojs/check':
specifier: ^0.9.3
@@ -803,11 +803,11 @@ packages:
resolution: {integrity: sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==}
hasBin: true
'@nanostores/persistent@0.9.1':
resolution: {integrity: sha512-ow57Hxm5VMaI5GHET/cVk8hX/iKMmbhcGrB9owfN8p8OHiiJgUlYxe1giacwlAALJXAh2t8bxXh42hHb64BCEA==}
engines: {node: ^16.0.0 || ^18.0.0 || >=20.0.0}
'@nanostores/persistent@0.10.2':
resolution: {integrity: sha512-BEndnLhRC+yP7gXTESepBbSj8XNl8OXK9hu4xAgKC7MWJHKXnEqJMqY47LUyHxK6vYgFnisyHmqq+vq8AUFyIg==}
engines: {node: ^18.0.0 || >=20.0.0}
peerDependencies:
nanostores: ^0.9.0
nanostores: ^0.9.0 || ^0.10.0 || ^0.11.0
'@netlify/functions@2.8.1':
resolution: {integrity: sha512-+6wtYdoz0yE06dSa9XkP47tw5zm6g13QMeCwM3MmHx1vn8hzwFa51JtmfraprdkL7amvb7gaNM+OOhQU1h6T8A==}
@@ -2585,9 +2585,9 @@ packages:
engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
hasBin: true
nanostores@0.9.5:
resolution: {integrity: sha512-Z+p+g8E7yzaWwOe5gEUB2Ox0rCEeXWYIZWmYvw/ajNYX8DlXdMvMDj8DWfM/subqPAcsf8l8Td4iAwO1DeIIRQ==}
engines: {node: ^16.0.0 || ^18.0.0 || >=20.0.0}
nanostores@0.11.3:
resolution: {integrity: sha512-TUes3xKIX33re4QzdxwZ6tdbodjmn3tWXCEc1uokiEmo14sI1EaGYNs2k3bU2pyyGNmBqFGAVl6jAGWd06AVIg==}
engines: {node: ^18.0.0 || >=20.0.0}
natural-compare@1.4.0:
resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==}
@@ -4365,9 +4365,9 @@ snapshots:
- encoding
- supports-color
'@nanostores/persistent@0.9.1(nanostores@0.9.5)':
'@nanostores/persistent@0.10.2(nanostores@0.11.3)':
dependencies:
nanostores: 0.9.5
nanostores: 0.11.3
'@netlify/functions@2.8.1':
dependencies:
@@ -6507,7 +6507,7 @@ snapshots:
nanoid@3.3.7: {}
nanostores@0.9.5: {}
nanostores@0.11.3: {}
natural-compare@1.4.0: {}

View File

@@ -8,7 +8,7 @@
import { persistentAtom } from "@nanostores/persistent";
import { getUrlDomain } from "@lib/url";
import { action, onMount } from "nanostores";
import { onMount } from "nanostores";
const OLD_LOCAL_STORAGE_KEY = "recentInstances";
const LOCAL_STORAGE_KEY = "savedInstances";
@@ -41,8 +41,10 @@ onMount($savedInstances, () => {
localStorage.removeItem(OLD_LOCAL_STORAGE_KEY);
});
export const save = action($savedInstances, "save", (store, instance) => {
store.set(
new Set([getUrlDomain(instance), ...store.get()].slice(0, CAPACITY)),
export const save = (instance: string) => {
$savedInstances.set(
new Set(
[getUrlDomain(instance), ...$savedInstances.get()].slice(0, CAPACITY),
),
);
});
};