This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-12-05
Channels
- # adventofcode (95)
- # announcements (3)
- # babashka (11)
- # beginners (39)
- # boot (19)
- # bristol-clojurians (1)
- # cider (32)
- # clj-kondo (39)
- # cljsrn (8)
- # clojure (156)
- # clojure-dev (35)
- # clojure-europe (4)
- # clojure-italy (15)
- # clojure-nl (28)
- # clojure-spec (43)
- # clojure-uk (153)
- # clojurescript (168)
- # core-async (13)
- # core-logic (11)
- # cryogen (4)
- # cursive (13)
- # datomic (26)
- # duct (3)
- # emacs (8)
- # fulcro (33)
- # garden (4)
- # graalvm (18)
- # graphql (4)
- # jobs-discuss (2)
- # kaocha (1)
- # leiningen (3)
- # malli (8)
- # off-topic (1)
- # pathom (7)
- # re-frame (21)
- # reagent (3)
- # rewrite-clj (1)
- # schema (4)
- # shadow-cljs (40)
- # sql (2)
- # uncomplicate (3)
Hey everyone. I'd like to open a new window but let it share state with the original window. I see how I could do this with a draggable modal, but I'm hoping for something which could eg. be moved over to a second monitor, so that you could use the original and new window at the same time. I know how to do the absolute basics of new window stuff (basically just (js/window.open "" "_blank" "height=200,width=200")
) and have a vague understanding of react portals https://github.com/reagent-project/reagent/blob/master/doc/ReactFeatures.md but I just don't seem to understand how to bridge the two. Could anyone help with a tiny code snippet? eg. storing a counter atom in the original window, which is live-displayed in a popup component
I'm quite new to js and cljs - please let me know I'm approaching this in a silly way!
Ah, I think I asked too soon. I just found this tutorial https://medium.com/hackernoon/using-a-react-16-portal-to-do-something-cool-2a2d627b0202 in case anyone else wants to know the answer
re-frame-10x does this without portals - https://github.com/day8/re-frame-10x/blob/master/src/day8/re_frame_10x/events.cljs#L273