This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-12-04
Channels
- # beginners (25)
- # boot (14)
- # business (1)
- # cljsrn (2)
- # clojure (180)
- # clojure-korea (14)
- # clojure-russia (8)
- # clojure-spec (9)
- # clojure-uk (17)
- # clojurescript (110)
- # cursive (14)
- # datomic (18)
- # emacs (23)
- # events (4)
- # garden (7)
- # hoplon (44)
- # lein-figwheel (1)
- # liberator (4)
- # london-clojurians (1)
- # om (10)
- # om-next (2)
- # onyx (22)
- # protorepl (60)
- # re-frame (36)
- # reagent (11)
- # ring (10)
- # yada (5)
@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 changes.md 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 "600123.sh"}'
after change the first two fields' value and press 'Send Input ==>' button. My intent is to make :model filed to be "600123.sh" and dispatch a [:send-input {:query "PE" :stockid "600123.sh"}]
(defn drawer-child []
(let [query (reagent/atom "")
stockid (reagent/atom "")]
(fn [{:keys [id label]}]
[re-com/v-box
;; :div.drawer-child
:children
[[re-com/box
:child
[:div.drawer-child-title id]],
[re-com/box
:child
[re-com/single-dropdown
:choices conf/home-choices
:model nil
:placeholder "Have a choice..."
:on-change #(reset! query %)] ;; <== reset query
:style
{
:padding "0 10px"
}],
[re-com/box
:child
[:div.stockid-input
[:div.stockid-label "Secucode:"]
[re-com/input-text
: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"]]
:style
{
:padding "0 10px"
}],
;; send input button
[re-com/box
:child
[re-com/button
:label "Send Input ==>"
:on-click #(dispatch
[:send-input
{:query @query
:stockid @stockid}]) ;; <== dispatch an event, not work even use dispatch-sync
:class "btn-warning"
]
:style
{
:padding "0 10px"
}],
]
:gap "10px"
]
))
)
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: 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 https://github.com/smahood/re-frame-conj-2016 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!
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.
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