Delete readmes, update docs
This commit is contained in:
+17
-1
@@ -1,6 +1,7 @@
|
||||
# @welshman/store
|
||||
|
||||
A utility package designed specifically for Svelte applications, providing enhanced store functionality and utilities for managing state. While it's primarily built for use with Svelte's store system, the concepts could be valuable for developers familiar with reactive programming patterns like RxJS.
|
||||
[](https://npmjs.com/package/@welshman/store)
|
||||
A utility package providing welshman-specific svelte store functionality and utilities for managing state. While it's primarily built for use with Svelte's store system, the concepts could be valuable for developers familiar with reactive programming patterns like RxJS.
|
||||
|
||||
## What's Included
|
||||
|
||||
@@ -10,6 +11,21 @@ A utility package designed specifically for Svelte applications, providing enhan
|
||||
- **Persistence Layer** - Automatic localStorage synchronization
|
||||
- **Performance Optimizations** - Throttled updates and efficient subscription management
|
||||
|
||||
## Quick Example
|
||||
|
||||
```typescript
|
||||
import {Repository, NAMED_PEOPLE, TrustedEvent, PublishedList, readList} from '@welshman/util'
|
||||
import {deriveEventsMapped} from '@welshman/store'
|
||||
|
||||
const repository = new Repository()
|
||||
|
||||
// Create a store that performantly maps matching events in the repository to List objects
|
||||
const lists = deriveEventsMapped<PublishedList>(repository, {
|
||||
filters: [{kinds: [NAMED_PEOPLE]}],
|
||||
eventToItem: (event: TrustedEvent) => (event.tags.length > 1 ? readList(event) : null),
|
||||
itemToEvent: (list: PublishedList) => list.event,
|
||||
})
|
||||
```
|
||||
|
||||
## Installation
|
||||
|
||||
|
||||
Reference in New Issue
Block a user