Got completely distracted the past two days but I think it will be worth it. I'm about half way through designing a modular event loading system for applesauce.

This would allow and app to pull in parts and customize how their app loads profiles. for example you could load from 2 event caches, a local relay, and then finally make connections out to public relays to look for the profiles

Still very much a WIP though, so not sure how will it will actually work

https://cdn.hzrd149.com/eef7990cf0a2dc0b1d9146b7850c1cdbf9182aa54ad173dab5ae6fd5cee74979.webp

Reply to this note

Please Login to reply.

Discussion

nostr:npub1cesrkrcuelkxyhvupzm48e8hwn4005w0ya5jyvf9kh75mfegqx0q4kt37c nostr:npub133vj8ycevdle0cq8mtgddq0xtn34kxkwxvak983dx0u5vhqnycyqj6tcza and nostr:npub1jlrs53pkdfjnts29kveljul2sm0actt6n8dxrrzqcersttvcuv3qdjynqn ( if you haven't given up on RxJS yet )

This is all RxJS based, so it should be fairly easy to build custom loading modules. since they would just be a function that takes an array of address pointers and returns an observable of events ( that completes )

So you can compose multiple loaders and can create multiple strategies of them? btw do you consume them directly in the UI?

Composing loaders maybe get very complicated because of caching and batching requests. But if they are customizable enough then it should be possible. I don't know yet because I still need to figure out how to get batching to work

For using them in the UI, the idea would be for the UI components to trigger them, but still use the event store as the source of truth

Does this have time-based cache invalidation? The problem I've run into with checking the cache first is you don't know if there's a new version of a replaceable event

no not yet, but this is why I'm trying to make things modular. it shouldn't be hard to modify the "load from cache" function to only look for events that had some "checked" flag newer than a week 🤔