This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-04-08
Channels
- # beginners (92)
- # boot (2)
- # cljsrn (6)
- # clojure (33)
- # clojure-austin (1)
- # clojure-dev (18)
- # clojure-spec (7)
- # clojure-uk (2)
- # clojurescript (35)
- # cursive (13)
- # data-science (3)
- # datomic (1)
- # defnpodcast (1)
- # figwheel (1)
- # fulcro (27)
- # instaparse (1)
- # java (2)
- # leiningen (8)
- # off-topic (5)
- # onyx (1)
- # portkey (2)
- # re-frame (9)
- # reagent (2)
- # ring-swagger (1)
- # shadow-cljs (136)
- # test-check (3)
- # tools-deps (29)
@matthewdaniel It’s fine to put it on every event, re-frame-10x drops old events (only keeps 5 by default), so it shouldn’t cause a problem, and if it does, please report it as ideally we’d like to have it on everything eventually
I’ve got a new feature coming which does ‘lazy’ printing of data structures, so if you only print the first 20 characters of a 20Mb map then you only pay a very small amount for it
when i have 10x open my css transitions are a bear. they kinda freeze the browser for up to a second or more. hiding the bar will turn the transitions back to normal speed.
Which panel are you on?
Same on all panels?
@U051KLSJF it is the worst on event. it is minimally there on the rest but usually negligible
Ok, the new version should be much faster there
Have a go with https://github.com/Day8/re-frame-10x/releases/tag/0.3.2, it should be much faster
@al.vyguzov I settled on 2 simple wrappers given
(def data-model
{:re-app {:counter 0}}) ;;<-- :re-app will be the namespace
a wrapper for events
(defn reg-event-ns
([event-name interceptors handler]
(rf/reg-event-fx
event-name
interceptors
(fn [{:keys [db]} evt]
(let [ns (keyword (namespace event-name))]
{:db (assoc db ns (handler (db ns) evt))}))))
([event-name handler]
(reg-event-ns event-name [] handler)))
and one for subs
defn reg-sub-ns
[sub-name handler]
(let [ns (keyword (namespace sub-name))]
(rf/reg-sub
sub-name
(fn [db evt]
(handler (db ns) )))))
used like so
(reg-event-ns
:re-app/inc ;;<-- :re-app ns
(fn [db [_]]
(update-in db [:counter] inc)))
(reg-sub-ns
:re-app/counter ;;<-- :re-app ns
(fn [db [_]]
(get-in db [:counter])))
(edit: wrong ns)