untangled

NEW CHANNEL: #fulcro
wilkerlucio 2016-11-06T00:10:26.003854Z

@keatondunsford I never tried, but I think it should

keatondunsford 2016-11-06T00:12:56.003855Z

Dope.

2016-11-06T18:57:52.003884Z

Hi all. I am trying to do the untangled-devguide but somehow I only get a blank page on http://localhost:3449/

2016-11-06T18:58:07.003885Z

I can see the tests passing on http://localhost:3449/test.html

2016-11-06T19:00:32.003886Z

I set cursive up as described in the tutorial

adambros 2016-11-06T19:21:14.003887Z

@nickik I dont use cursive, i just run this stuff directly in the repl, so I think it’s an issue with your cursive config

adambros 2016-11-06T19:21:49.003888Z

I did run into the same issue, which I think is yours, is that i didnt start the ”devguide” cljs build

adambros 2016-11-06T19:22:08.003889Z

so you are probably just forgetting to put -Ddevguide in your cursive build configuration

2016-11-06T20:19:33.003895Z

@adambros Thank you. I have done so already.

2016-11-06T20:19:47.003896Z

I think this should be updated in the provided picture. Its kind of confusing and causes unnecessary delay.

adambros 2016-11-06T20:31:26.003897Z

@nickik @tony.kay ah i see, made this for ya https://github.com/untangled-web/untangled-devguide/issues/28

adambros 2016-11-06T20:34:03.003901Z

@tony.kay I’m having trouble using :return-handler to affect state, no matter what I do it seems the state in (fn [{:keys [state]} _ _] …) is not actually the same as in the rest of the app

adambros 2016-11-06T20:35:24.003902Z

I’ve even tried calling transact! to no avail

adambros 2016-11-06T20:36:59.003903Z

am i not supposed to mutate state in return-handler?

adambros 2016-11-06T21:16:50.003906Z

@tony.kay

(defn my-merge-handler [state-atom return-handler target source]
  (letfn [(doreturn [trigger-symbol return-value]
            (return-handler {:state state-atom} trigger-symbol return-value))]
    (let [handled-source (reduce (fn [acc [k v]]
                                   (cond
                                     (symbol? k) (let [v-without-tempids (if (map? v)
                                                                           (dissoc v :tempids)
                                                                           v)]
                                                   (if return-handler
                                                     (merge acc (doreturn k v-without-tempids))
                                                     (dissoc acc k)))
                                     :else acc)) source source)]
      (untangled.client.impl.application/sweep-merge target handled-source))))

(set! untangled.client.impl.application/merge-handler my-merge-handler)
Yeah it looks like I have to tweak it to get it to do what I want. Is there a reason for this? I’m trying to update a last-action timestamp whenever a successful remote happens, is this not how I should do it?

adambros 2016-11-06T21:23:41.003910Z

It could make sense for it to just be in the networking layer, a :untangled/last-ok-remote-timestamp -ish

2016-11-06T22:21:34.003914Z

@adambros Thanks you. I hope it saves somebody else some trouble.