This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-08-21
Channels
- # announcements (15)
- # beginners (82)
- # calva (19)
- # cider (7)
- # clj-kondo (7)
- # clojure (81)
- # clojure-brasil (8)
- # clojure-dev (37)
- # clojure-europe (2)
- # clojure-italy (7)
- # clojure-nl (8)
- # clojure-spec (5)
- # clojure-uk (14)
- # clojurescript (67)
- # cursive (13)
- # datomic (29)
- # defnpodcast (2)
- # figwheel-main (19)
- # fulcro (9)
- # graalvm (5)
- # iot (3)
- # off-topic (16)
- # other-languages (1)
- # overtone (1)
- # pathom (4)
- # protorepl (2)
- # re-frame (25)
- # reagent (1)
- # shadow-cljs (126)
- # spacemacs (9)
- # sql (2)
- # test-check (24)
- # tools-deps (11)
Hello guys
i'm trying to make a simple file upload, briefly the idea is in the input with type file i have on-change fun which will set the file using an event at the app db, and there is another button to submit it, i access the file from db and attach to params and send why couldn't i do this ?
is it possible to save js/File on app-db of reframe ?
@abdullahibra It is possible to store the file in memory in re-frame’s app-db
, however I personally would avoid that in my apps because, like functions, they don’t serialize and I prefer re-frame state to be able to be re-hydrated. Also localStorage concerns.
@oconn so you fetch it using getelementbyid method?
Sounds like a form-2 component could hold the file object if you just need a pointer to it right there
i tried to save it at app-db but i got no tag for object
So if you want to store it in re-frame, I would expect that you could dispatch the file object and subscribe directly to it in the component that cares about it.
ah ok
lemme try it
@oconn can i register cofx for it ?
yes @abdullahibra i would generally put a js/File
object somewhere else, outside the app-db, perhaps in an atom
with an {<id> File}
map, then put the <id>
in the app-db and retrieve the File
where necessary with a cofx
thanks guys
^ yep, I would go with the first approach if no other components / events care about the file, the second if they do.
@oconn @mccraigmccraig i have tried it, but i can not associate to atom file
Error: No protocol method IAssociative.-assoc defined for type cljs.core/Atom: [object Object]
that's how i get the file from input file type
an atom is not a map @abdullahibra - you change the contained value with swap!
- (swap! attachments assoc (str (.-name file)) file)
oh forgot
is it possible to use the tracing output of re-frame 10x without starting the devtool. Thinking about react native use case again
@danieleneal
There are a few layers/sources of the trace
re-frame
itself is instrumented and produces trace. re-frame-10x
is a consumer of this trace
Then there's the whole dubux fn-traced
instrumentation you can add to your event handlers. re-frame-10x
consumes this, if you use the right macros. https://github.com/Day8/re-frame-debux
Then finally, re-frame-10x
gets drunk on power and does a couple of glorious monkey patch hacks to squeeze even more trace out of reagent
It then combines, curates and renders this "total trace" in an epoch-oriented fashion.
Hmm. Looking back, I think I misread your question. You are not looking to source trace LIKE re-frame-10x and build another consumer.
Instead, you are wondering if re-frame-10x
itself can make available the trace it collects for use by another consumer. Ie. re-frame-10x
is still part of the solution.
My answer for that is unhelpful, sorry: its been a while and I can't remember. Probably. Ultimately, all the raw trace is kept in an atom somewhere.