Content pfp
Content
@
0 reply
0 recast
2 reactions

Gabriel Ayuso pfp
Gabriel Ayuso
@gabrielayuso.eth
There's no way an app will be fast enough without keeping most state local. Having a proper sync engine and local state isn't trivial but once it's setup you can reduce a lot of the issues that come with fetching and caching since the sync engine ensures that your app has the data and it's up to date. https://x.com/karrisaarinen/status/1834463400975544778
6 replies
7 recasts
28 reactions

Samuel pfp
Samuel
@samuellhuber.eth
Have you played around with local first sync? one thing I am yet to figure out is how to show the few parts one has 3rd party APIs in a way that's pleasant if the rest is so fast.
1 reply
0 recast
0 reaction

Gabriel Ayuso pfp
Gabriel Ayuso
@gabrielayuso.eth
I've done "local first" on native, not on web yet. It's possible to do local first with 3p APIs you just need to write a custom way to continuously call the APIs and merge the results with the data you have locally. That's basically what I did with Tumblr APIs back in the day. You could also just integrate the 3p API on your backend and not your client, if possible.
2 replies
0 recast
1 reaction

Samuel pfp
Samuel
@samuellhuber.eth
yeah I was thinking about polling it, though if the user has a "needs to be current at modal popup" then that may lead to the polling of say ~15s to not be up to date. or I need to go a push based route of pushing updates to the local state and have the backend manage that. then user can add locally and gets backend adds instantly or API writes throuhg pushes. I hate the thought of going back to polling backends just to be recent but in some cases it seems like that's the way without webhooks being there. e.g. twitter API
1 reply
0 recast
1 reaction

Timi pfp
Timi
@timigod.eth
I haven’t tried it yet but I think this https://www.instantdb.com/ makes it relatively trivial to get up and running for a vast majority of use cases.
1 reply
0 recast
1 reaction