forked from coracle/flotilla
Add checked store and set data
This commit is contained in:
+11
-1
@@ -1,9 +1,10 @@
|
||||
import twColors from "tailwindcss/colors"
|
||||
import {get, derived} from "svelte/store"
|
||||
import {get, derived, writable} from "svelte/store"
|
||||
import {nip19} from "nostr-tools"
|
||||
import type {Maybe} from "@welshman/lib"
|
||||
import {
|
||||
ctx,
|
||||
now,
|
||||
setContext,
|
||||
remove,
|
||||
assoc,
|
||||
@@ -16,6 +17,7 @@ import {
|
||||
nthEq,
|
||||
shuffle,
|
||||
parseJson,
|
||||
prop,
|
||||
} from "@welshman/lib"
|
||||
import {
|
||||
getIdFilters,
|
||||
@@ -259,6 +261,14 @@ export const deriveEventsForUrl = (url: string, filters: Filter[]) =>
|
||||
),
|
||||
)
|
||||
|
||||
// Last checked timestamps, notifications
|
||||
|
||||
export const checked = writable<Record<string, number>>({})
|
||||
|
||||
export const deriveChecked = (key: string) => derived(checked, prop(key))
|
||||
|
||||
export const setChecked = (key: string, ts = now()) => checked.update(assoc(key, ts))
|
||||
|
||||
// Settings
|
||||
|
||||
export const SETTINGS = 38489
|
||||
|
||||
Reference in New Issue
Block a user