Fork me on GitHub

Hi! If I use path interceptor, then in this event handler, I can not refer to keys other than the one specified by path, right? If this is not right, how should I use (path :key-a) and at the same time refer to (:key-b db)?


i think the idea of path is to change value in path 🙂


When we change the value of (:key-a db), can we use the value of (:key-b db), if we use (path :key-a) interceptor?


you don't have db in the handler, only value of (:key-a db)


ok, Thanks!


@cmal so, if you want to change only value of (:path1 (:path2 :db)) , and you don't need any other values from :db you are using path, for example you want to set visible to true (:visible (:window :db)) , and you dispatch [:visible true] , if you want something more from :db you are not using path 🙂


@andre Thanks. So I think the path interceptor is useful only if data in the path depends on nothing else in db.


Solved! I've moved the mount-root window-width, and on-window-resize to views.cljs and it works. --- original question --- Hi! I am adding an on-window-resize event handler to my re-frame project. I looked to reagent's doc and found this: , which shows adding window-width, on-window-resize and (.addEventListener js/window "resize" on-window-resize) to main function. I've added them to the mount-root function of re-frame-template, then I want to refer to window-width and on-window-resize in views.cljs. If I use [my-project.core] or something similar in views.cljs, it will show circular dependency detected. What is the right way to do this? Thanks!


Had a lot of fun writing this widget over past few evenings. I learned a ton; cofx, :dispatch-later, undo (incredibly easy to integrate btw!), and how to use third party react components (take a look at flip-move in case you need to animate lists). Thanks for the support and great documentation!


(scroll down to the bottom of the post to see the demo)


@upgradingdave Oh, I love that, thanks. We will be having a close look at how you pulled this off, first thing Monday.