re-frame

https://github.com/Day8/re-frame/blob/master/docs/README.md https://github.com/Day8/re-frame/blob/master/docs/External-Resources.md
anonimitoraf 2021-06-08T04:21:06.069600Z

Hey guys, I've tried googling around but had no luck. How do you handle page refreshes? re-frame (just like redux) gets its state blown away, but it seems like people have written packages to serialize state and save into local storage (like https://github.com/rt2zz/redux-persist). My last resort is writing something like that^ myself Are there better ways of solving this problem?

Oliver George 2021-06-08T05:04:25.071200Z

Probably not the answer you're after but I've been fine without local caching of data for webapps. Mobile apps are another case - I use sqlite for my #cljsrn apps. I also watch #datahike to see if they release a gamechanging datalog based persistance for web/mobile apps.

anonimitoraf 2021-06-08T09:33:35.072300Z

> but I've been fine without local caching of data for webapps How so? What happens when a user refreshes a page?

Oliver George 2021-06-15T01:44:54.121800Z

We don't have an "offline first" approach to our webapp. It's essentially a nice interface to a REST API. Refreshing the browser bootstraps the app which fetches any data it needs. Our data model is complicated. This approach would generate a lot of requests except that we've provided a "pull api" mode which amounts to a poor-mans GraphQL. Goal is saving query count (at the cost of complicating bakend db queries)

2021-06-08T06:40:30.072200Z

@nicdaoraf The todomvc example in the re-frame repo saves to local storage. Very simple example but perhaps indicative??

anonimitoraf 2021-06-08T09:33:46.072500Z

Ah, thanks. I'll check that out