Good to know. Still trying to understand the model/loader patterns and how to best cache data between react components.

Reply to this note

Please Login to reply.

Discussion

The react documentation is lacking, but generally you want to use the model for everything since they act like react-query and deduplicate subscription.

The loaders are confusing, but they are used to request new events from relays. integrating them into the models is a pain right now because I haven't found a way to make them plug together cleanly without turning applesauce into a monolith / black box

The cleanest way I've found so far is to create a custom `ProfileQuery` model that will request the event from the default relays if its not present in the event store

https://github.com/hzrd149/applesauce/blob/master/packages/examples/src/examples/nutzap/zap-profile.tsx#L56-L71