This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-11-19
Channels
- # bangalore-clj (1)
- # beginners (8)
- # boot (102)
- # cider (1)
- # clara (14)
- # cljs-dev (2)
- # cljsrn (2)
- # clojure (49)
- # clojure-poland (3)
- # clojure-russia (4)
- # clojure-serbia (1)
- # clojure-spec (5)
- # clojure-ukraine (1)
- # clojurescript (181)
- # core-async (4)
- # cursive (2)
- # datomic (7)
- # dirac (34)
- # figwheel (3)
- # fulcro (21)
- # hoplon (5)
- # om (1)
- # parinfer (4)
- # planck (27)
- # re-frame (30)
- # reagent (11)
- # rum (6)
- # shadow-cljs (22)
- # spacemacs (4)
- # unrepl (26)
@manu
i used reagent.core/as-component
, like this:
(def refresh-control (adapt-react-class (.-RefreshControl ReactNative)))
...
(defn refresh [sub event]
(let [refreshing? (subscribe [sub])]
(fn [sub event]
[refresh-control {:refreshing @refreshing?
:on-refresh #(dispatch [event])}])))
...
(defn headings-panel []
(let [headings (subscribe [:last-headings])]
(fn []
[scroll-view {:refresh-control (r/as-component [refresh
:refreshing-headings?
:refresh-last-headings])}
(if (seq @headings)
(for [[i heading] (map-indexed vector (take 30 @headings))]
^{:key i} [text {:style (:entry styles)}
(humanize-heading heading)])
[text {:style {:text-align :center}}
"no headings"])])))
Just updated the expo-cljs-template
to v22. If you’ve been dying to try Clojurescript + Expo, head over here for the latest and greatest. Many thanks to @drapanjanas as I’ve liberally borrowed from his project (especially w/r/t the recent Figwheel upgrades). 🙂
https://github.com/seantempesta/expo-cljs-template