Fork me on GitHub
#re-frame
<
2017-04-30
>
mikethompson02:04:51

@qqq an vbox of children representing each of the previous chat? re-com doesn't have a "previous chat" component :-)

curlyfry11:04:46

@eveko Do you perhaps have some side-effecting logic somewhere that's not wrapped in a function or a defonce? Figwheel will evaluate that code on reload

eveko14:04:42

maybe is this the culprit? @curlyfry

curlyfry14:04:37

@eveko Maybe, how do you call it?

eveko14:04:10

(defn ^:export init [] (re-frame/dispatch-sync [:initialize-db]) (dev-setup) (mount-root))

eveko17:04:29

i find the call that does the duplication of data! , it is my authentication call..., don't know why this duplicates the db atom though

eveko17:04:24

this will nest my app db like so...

Oliver George22:04:42

Is there an idiomatic way to thread -fx helpers? In particular, fx event handlers take an old-world map with {:keys [db event]} and return a new-world map with a different signature {:keys [db dispatch-v xhrio-get]}. Note: leaving the :event key there causes an error (no cofx handler registered) I'd like to write fx helpers with the sig ([old-world & args] -> [new-world]) but this means you can't thread them: the output new-world isn't compatible as an input to a second helper.

Oliver George22:04:14

I can see that some helper wrappers could be used to do the data massaging between steps.

ravster22:04:50

I'm looking through https://github.com/Day8/re-frame-http-fx . Does this library exist to take care of the async nature of HTTP calls, and changing the app-state after the call is successful? I'm trying to figure out what it does in addition to clj-ajax.

danielcompton23:04:27

@ravster it's an fx for turning side effects into data

ravster23:04:46

@danielcompton thanks. Experimenting with it now.

danielcompton23:04:26

@olivergeorge I don't really think of fx handlers as taking an old world, and returning a new world, I think of them as taking a map of cofx and returning new fx

danielcompton23:04:49

I think maybe what you could do is make a function sig [cofx fx & args] -> [cofx new-fx]

danielcompton23:04:15

where you build up new-fx through the functions, similar in manner to interceptors

danielcompton23:04:33

however you start to reinvent re-frame inside re-frame if you go too far down that path