0.1.0 • Published 6 months ago

@welshman/store v0.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
6 months ago

@welshman/store version

Utilities for dealing with svelte stores when using welshman.

import {Repository, NAMED_PEOPLE, NAMED_TOPICS, type TrustedEvent, readUserList, List} from '@welshman/util'
import {deriveEventsMapped} from '@welshman/store'

const repository = new Repository()

// Create a svelte store that performantly maps matching events in the repository to List objects
const lists = deriveEventsMapped<PublishedUserList>(repository, {
  filters: [{kinds: [NAMED_PEOPLE, NAMED_TOPICS]}],
  eventToItem: (event: TrustedEvent) => (event.tags.length > 1 ? readUserList(event) : null),
  itemToEvent: (list: List) => list.event,
})
0.1.0

6 months ago

0.0.16

8 months ago

0.0.15

9 months ago

0.0.13

9 months ago

0.0.14

9 months ago

0.0.12

11 months ago

0.0.11

11 months ago

0.0.10

11 months ago

0.0.9

11 months ago

0.0.8

12 months ago

0.0.5

1 year ago

0.0.7

12 months ago

0.0.6

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago