Fork me on GitHub
#untangled
<
2016-11-06
>
wilkerlucio00:11:26

@keatondunsford I never tried, but I think it should

nickik18:11:52

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

nickik18:11:07

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

nickik19:11:32

I set cursive up as described in the tutorial

adambrosio19:11:14

@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

adambrosio19:11:49

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

adambrosio19:11:08

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

nickik20:11:33

@adambros Thank you. I have done so already.

nickik20:11:47

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

adambrosio20:11:03

@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

adambrosio20:11:24

I’ve even tried calling transact! to no avail

adambrosio20:11:59

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

adambrosio21:11:50

@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?

adambrosio21:11:41

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

nickik22:11:34

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