Fork me on GitHub

@andre: That diagram would have been very helpful last week :)


@colin.yates thanks you for your kind explanation. I learned a lot from that. 👍


Based on the file in the developbranch, am I correct that we should now be including clear-subscription-cache! in our figwheel on-jsload (or equivalent) all the time in 0.9?


The following code is working now. This problem seems to be related to the events.cljs not be auto re-compiled. ----------- original question ---------- Hi, Is this problem related to that I did not use dispatch-sync? I have the following code and got an error of :model in component 'input-text': Expected 'string|atom'. Got '{:query "PE", :stockid ""}' after change the first two fields' value and press 'Send Input ==>' button. My intent is to make :model filed to be "" and dispatch a [:send-input {:query "PE" :stockid ""}]

(defn drawer-child []
  (let [query (reagent/atom "")
        stockid (reagent/atom "")]
    (fn [{:keys [id label]}]
       ;; :div.drawer-child
         [:div.drawer-child-title id]],
          :choices conf/home-choices
          :model nil
          :placeholder "Have a choice..."
          :on-change #(reset! query %)]  ;; <== reset query
          :padding "0 10px"
          [:div.stockid-label "Secucode:"]
           :class (log @query @stockid)
           :model stockid   ;; <== Error on validating :model! My intent is to make it an atom of string, but got an hashmap. I don't know why.
           :on-change #(reset! stockid %)  ;; <== reset stockid
           :placeholder "600123.SH"]]
          :padding "0 10px"
        ;; send input button
          :label "Send Input ==>"
          :on-click #(dispatch
                       {:query @query
                        :stockid @stockid}])  ;; <== dispatch an event, not work even use dispatch-sync
          :class "btn-warning"
          :padding "0 10px"

       :gap "10px"


And is it only me who can't find any info how to work with re-frame and figwheel?


I remember when I started to work with re-frame, I found that it was impossible to autoreload with figwheel, and since then has not looked


@andre have you tried dirac?


I've been working in Chrome Canary with dirac and it is amazing.


@andre: I'll try to put something in the FAQ tomorrow for both figwheel and for global interceptors


@shaun-mahood so the idea is to re-render root view on figweel js on load?


Yeah, and you only re-do your app-db init on the first load


Code at should have a config that will work


Hi, I've encountered a strange problem now. I am currently using the reframe-template to build a demo site. I changed the value of db/default-db, and I re-run everything (lein figwheel dev, lein repl, chrome, even Emacs), but the app-db will not change. If I try to (dispatch-sync [:initialize-db]) manually, the app-db still will not change. BUT when I re-edited(even not change the value of db/default-db) the db.cljs and save and then (dispatch-sync [:initialize-db]) manually the app-db CHANGED. BUT when I try to reload chrome page, and restart lein figwheel dev, the app-db get BACK to the original value. It is very strange for me because the original value of app-state or default-db is in no where of my code now! I've tried this again and again and again, the app-db still remains the original value and will never change again except that I do the second dispatch-sync thing above. I tried to get the value of db/default-db in repl and found it remains the original value. Why? How can I deal with this problem? Thanks!


where are you looking db value?


Even the compiled db.js file is using a correct value.




and repl


so you change db value and run figwheel but the value in re-frisk and repl is old?


no, repl's value is new now. I don't know why. But in re-frisk is still the old.


are you looking in the panel or separate browser's window?


I see, maybe a browser's cash rewrite the value to app-db


did you refresh page and reopen the re-frisk window?


yes. it's better to hot reload


I re-opened browser but does not clean the cache


I'll try that


bingo! that is the problem! thank you @andre !


i think it can be confusing, i'll add in the todo list. because if you open re-frisk in separate window, and refresh the main app window, re-frisk window doesn't work anymore, i should make some tooltip for what


I think the problem confusing me is about the browser cache. Is the :app-db set on somewhere in browser cache? If not, no reason that I changed the code and restart the project but the app-db still the old. Only if the browser read the cache of app-db and then my code call some event to change the app-db based on the value cached so the new app-db is flushed.


where are you looking app-db in panel or separate window?


You mean panel or separate window of re-frisk? I am always using a seperate window. I'll try again and see whether the problem recur.


but. it doesn't matter, because the data in the app window, so you just have cached your application, re-frisk can't help here, ok, thank you


I am not doing cache. I tried again and found that the app did not cache the state, either. I just surmised that to happen. I wonder why just now it works after I cleaned the cache. curious.


I am going to sleep, it is 01:30. Thank you today.


@cmal have a good sleep. sorry for my english, i mean browser cashed, not you 🙂