This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-06-17
Channels
- # announcements (2)
- # aws (4)
- # babashka (20)
- # beginners (256)
- # calva (15)
- # chlorine-clover (1)
- # cider (12)
- # clj-kondo (25)
- # cljsrn (16)
- # clojure (115)
- # clojure-europe (7)
- # clojure-finland (5)
- # clojure-italy (10)
- # clojure-nl (35)
- # clojure-spec (13)
- # clojure-uk (83)
- # clojurescript (42)
- # code-reviews (81)
- # conjure (8)
- # cursive (6)
- # data-science (1)
- # datomic (3)
- # duct (18)
- # emacs (2)
- # figwheel-main (40)
- # fulcro (21)
- # helix (1)
- # jackdaw (7)
- # java (2)
- # lein-figwheel (5)
- # luminus (1)
- # observability (12)
- # off-topic (32)
- # parinfer (5)
- # pedestal (19)
- # re-frame (5)
- # reagent (8)
- # reitit (17)
- # rewrite-clj (47)
- # rum (19)
- # shadow-cljs (48)
- # spacemacs (4)
- # sql (40)
- # tools-deps (22)
- # vrac (1)
- # xtdb (25)
When running figwheel it seems none of my subscriptions reload. Is there some setting or coarse of action I need to take to use figwheel properly with re-frame ?
Probably this: https://github.com/day8/re-frame/blob/master/docs/FAQs/Why-Clear-Sub-Cache.md
how did you solve this issue i created an app (react native) that deals with orientation a lot and there are a lot of places where UI should change based on orientation so i decided instead of having subscribe to orientation all over the app instead id abstract default view and just use that component but i run into a problem.
(defn view [& [props & children]]
(let [config (rf/subscribe [:app-config/all])]
(fn []
(let [{:keys [orientation]} @config]
(reduce (fn [base child]
(conj base child))
[:> rn/View (merge {:style {:flex 1
:flex-direction orientation}}
props)]
children)))))
This is the view
abstraction
but when i use it like
[comps/view
{}
[:> rn/View {:style {:flex 1
:padding 10
:justify-content :space-around
:align-items :center
:background-color :red
}}
[:> rn-elem/CheckBox {:center true
:title "BUY"
:checked-icon :dot-circle-o
:unchecked-icon :circle-o
:checked (= @action :buy)
:on-press #(reset! action :buy)
:checked-color :black}]
[:> rn/Text {:style {:font-weight :bold
:font-size 24
:color :black}} "OR"]
[:> rn-elem/CheckBox {:center true
:title "SELL"
:checked-icon :dot-circle-o
:unchecked-icon :circle-o
:checked (= @action :sell)
:on-press #(reset! action :sell)
:checked-color :black}]]
(if (= :buy @action)
[buy-details @option @gameplay (second selected-option)]
[sell-details @option @gameplay (second selected-option)])]
it is as though option
gameplay
and action
are non existent, like reactions are not happening, checkboxes don't work.
What i think is happening is that view
component's scope doesn't see option, gameplay or action and it fails.
is there a way to deal with this?
any way to make it work?
i'd appreciate feedback on the approach as well. Should i be doing this in a different way?