This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-11-01
Channels
- # aleph (1)
- # bangalore-clj (5)
- # beginners (24)
- # boot (113)
- # cider (42)
- # cljs-dev (2)
- # cljsjs (2)
- # cljsrn (3)
- # clojure (37)
- # clojure-austin (4)
- # clojure-brasil (3)
- # clojure-france (55)
- # clojure-greece (15)
- # clojure-ireland (4)
- # clojure-italy (13)
- # clojure-russia (37)
- # clojure-spec (50)
- # clojure-uk (31)
- # clojurescript (49)
- # component (12)
- # consulting (1)
- # cursive (6)
- # datascript (9)
- # datomic (27)
- # editors (2)
- # garden (1)
- # hoplon (18)
- # jobs (1)
- # klipse (25)
- # lein-figwheel (1)
- # leiningen (1)
- # luminus (2)
- # om (53)
- # om-next (8)
- # onyx (5)
- # parinfer (4)
- # perun (4)
- # re-frame (13)
- # remote-jobs (1)
- # ring (1)
- # ring-swagger (3)
- # rum (52)
- # spacemacs (36)
- # specter (13)
- # sql (3)
- # untangled (49)
- # vim (11)
- # yada (9)
Please someone tell me whether app-db
can contain non-literal values such like file objects embedded in <input type=”file”>
?
@akiroz Thank you. For maintaining replay-ability, I'd thought app-db
value should be serializable one.
Although reading your reply… I expect you’re right. If you want to be able to trace the whole thing, then chances are you’d want the message parameters to be easily serializable.
@knjname we stick strictly to the "only data" rule. Only data in app-db
. Only data in events
But, yes, file objects are possible
@mikethompson Definitely reasonable and what we do as well. But I thought it was important to clarify there’s no magic going on.
What if we want to avoid storing such dirty objects in app-db
, how can it be? In my case, an SPA user can choose a file :on-change #(dispatch [:store-file (get-file %)])
, and upload the file when pushing upload button #(dispatch [:upload-file])
. (Maybe in this simple case, you would recommend me to use local state in the first place.)
Are there any docs or blog posts that talk about integrating re-frame applications inside of other re-frame applications? I have a hefty reagent component (a data table with lots of features) that's powered by re-frame that I'd like to offer to myself as a dependency in another re-frame project. When the component is required I'd like it to use the parent application's app-db where lots of data is already available. Before I start chasing rabbits, is there a best practice for this?
I'd also like to dispatch events internal to the embedded re-frame application from the parent application. 🙂
@knjname I have file upload with re-frame in my last project, and I keep the filename in a local ratom. So that on-change
acts only on the ratom, and on-click
on the submit button I just dispatch [:upload-file file]
and do it with cljs-ajax in a handler