What is Nostr?
hzrd149 /
npub1ye5…knpr
2025-02-09 16:27:02
in reply to nevent1q…y3en

hzrd149 on Nostr: I'm using react and I wrote my own small useObservable hook that lets components ...

I'm using react and I wrote my own small useObservable hook that lets components subscribe to the value of an rxjs observable
https://github.com/hzrd149/applesauce/blob/master/packages/react/src/hooks/use-observable.ts
I don't know if svelte has native support for observable, but Im sure you could write a really simple helper method that would allow components to use them. ( want to build a applesauce-svelte package 😉 )

Applesauce is broken into a few parts but the core of it is a large collection of helper methods https://hzrd149.github.io/applesauce/typedoc/modules/applesauce_core.Helpers.html and the in-memory EventStore https://hzrd149.github.io/applesauce/overview/events.html
The EventStore ( and QueryStore ) are designed to store all the events the UI layer needs and they expose a bunch of different observable methods that let components subscribe to events ( timelines, lists, profiles, zaps, replies, etc )
https://hzrd149.github.io/applesauce/overview/events.html
Author Public Key
npub1ye5ptcxfyyxl5vjvdjar2ua3f0hynkjzpx552mu5snj3qmx5pzjscpknpr