refactor initial database and state management

This commit is contained in:
Ren Amamiya
2023-03-01 15:35:10 +07:00
parent 964343ccc8
commit 458f826958
24 changed files with 259 additions and 506 deletions

View File

@@ -1,10 +0,0 @@
import { persistentAtom } from '@nanostores/persistent';
export const currentUser = persistentAtom(
'currentUser',
{},
{
encode: JSON.stringify,
decode: JSON.parse,
}
);

View File

@@ -1,10 +0,0 @@
import { persistentAtom } from '@nanostores/persistent';
export const follows = persistentAtom('follows', [], {
encode(value) {
return JSON.stringify(value);
},
decode(value) {
return JSON.parse(value);
},
});

View File

@@ -1,25 +0,0 @@
import { persistentAtom } from '@nanostores/persistent';
export const relays = persistentAtom(
'relays',
[
'wss://relay.uselume.xyz',
'wss://nostr-pub.wellorder.net',
'wss://nostr.bongbong.com',
'wss://nostr.zebedee.cloud',
'wss://nostr.fmt.wiz.biz',
'wss://nostr.walletofsatoshi.com',
'wss://relay.snort.social',
'wss://offchain.pub',
'wss://nos.lol',
'wss://relay.damus.io',
],
{
encode(value) {
return JSON.stringify(value);
},
decode(value) {
return JSON.parse(value);
},
}
);