Fork me on GitHub
#re-frame
<
2016-06-15
>
danielcompton00:06:26

not sure sorry, gtg

tawus00:06:28

@danielcompton: No problem. Will figure it out. Thanks again for all the help.

bpicolo01:06:52

Is there a sane way to update a local-state atom when a handler has been..finished?

bpicolo01:06:30

say I have some (render-foo [] (let [loaded (r/atom false]] (fn [] [render something based on atom value)

bpicolo01:06:42

and I want to update loaded in some way after some async data in a background has returned

bpicolo01:06:54

(that this function really doesnt have knowledge of)

bpicolo01:06:59

other than a reaction to it rerunning this

bpicolo01:06:54

The particular use case is I have a form that I want to pre-fill when that data is finally loaded

danielcompton02:06:23

@bpicolo: when the other one come back, it needs to call a new handler

fasiha15:06:18

Mike Thompson's undo/redo made me think how awesome it'd be for re-frame to have something like CoreObject's UI https://www.youtube.com/watch?v=KD8xa3ku1qA (hat tip to @conaw)

conaw15:06:36

Its interesting, Redux can do some pretty interesting stuff because all mutations to state are just immutable events that are reduced over to achieve final state. Makes it real easy to remove something from history and have it change state. I wonder how one might get same sort of experience with Re-frame

symbit16:06:04

@darwin I don't follow your last point. The profile String is in Clojure on the server from the initial GET request to start the app. Without putting it in the JS space in the returned bootstrap html page with (javascript-tag ...), how would the re-com GUI access the String?

darwin16:06:20

@symbit: go into DevTools js console and type document.location

darwin16:06:50

the html page has access to current url, you can parse it with javascript

darwin16:06:00

if I understand it correctly from your last snippet, you obtain title and profile values from request url, which is exactly the same url seen on client-side

symbit16:06:46

@darwin I see it. gotcha. Thank you!

mikethompson21:06:44

@conaw: easy to do the same in re-frame (since before redux existed :-)) if someone wants to create the chrome extension.