Fix relay profile loading, add getTopicTags, allow mapping events to multiple items

This commit is contained in:
Jon Staab
2024-09-11 09:15:03 -07:00
parent bece689530
commit 4e113faa1a
7 changed files with 62 additions and 40 deletions
+10
View File
@@ -131,4 +131,14 @@ export const storageAdapters = {
fromPairs(data.map(({key, value}) => [key, value])),
}),
}),
fromMapStore: <T>(store: Writable<Map<string, T>>) => ({
keyPath: "key",
store: adapter({
store: store,
forward: ($data: Map<string, T>) =>
Array.from($data.entries()).map(([key, value]) => ({key, value})),
backward: (data: {key: string, value: T}[]) =>
new Map(data.map(({key, value}) => [key, value])),
}),
}),
}