Jayzus
Jayzus
CCConvex Community
Created by Jayzus on 9/27/2024 in #support-community
Legend-State plugin for local-first
I'm investigating making a Legend-State plugin and can use some help with some things. The first thing is it ideally works the same way when given a ConvexClient from React or from vanilla JS. So the first thing I'm trying to set up is to use onUpdate when given either a ConvexClient or a ReactConvexClient. But it seems like they work very differently - in React it internally uses a ConvexReactClient.watchQuery whereas the script tag example uses ConvexClient.onUpdate. Looking through the source iIt looks like ConvexReactClient and ConvexClient share a BaseConvexClient base class, and I could use subscribe on there. But is that the best way to go? Seems like I'd miss out on some of the nice behavior from the higher level wrappers. I can do that to get an initial prototype working but I'd like to make sure it works in the correct Convex way.
109 replies