Fork me on GitHub
#re-frame
<
2021-12-29
>
beders18:12:10

good morning, my google and clojars searches have come up empty so far: Anyone aware of a re-frame fx handler that deals with triggering a local download in the browser? Otherwise I’ll just go and wrap this: http://marianoguerra.org/posts/download-frontend-generated-data-to-a-file-with-clojurescript.html

Gerome06:12:45

I'm also wrapping this. I don't think there is a library for that.

Noah Bogart21:12:23

i am experimenting with using a fork of re-frame as my server-side “framework” for a subset of my application, and I have been fairly successful in moving the request/response handling to reg-event-fx and reg-fx respectively. it’s actually forced me to change how i write a lot of stuff for the better: writing pure functions that are event data in, db/fx data out and then using the fx handlers to perform very simple side effects. I’ve run into a bit of a conundrum tho. So far, my events haven’t relied on anything except the in-memory app-db, but now I’m converting request handler functions that make database calls and then perform modifications on the queried data. This makes it hard to write pure functions. I can’t figure out how to pass in the event vector to an interceptor so I can write one that will do my query, leaving the reg-event-fx function pure. is it possible to expose the event vector in an interceptor?

Noah Bogart22:12:10

nevermind, i found the answer I had been looking for soon as I sent that, lol