This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-08-07
Channels
- # bangalore-clj (2)
- # beginners (53)
- # boot (30)
- # cider (27)
- # clara (1)
- # cljs-dev (18)
- # cljsrn (16)
- # clojure (153)
- # clojure-brasil (1)
- # clojure-dusseldorf (5)
- # clojure-italy (20)
- # clojure-losangeles (3)
- # clojure-spec (4)
- # clojure-uk (177)
- # clojurescript (115)
- # component (4)
- # core-logic (1)
- # datomic (29)
- # emacs (9)
- # figwheel (2)
- # gorilla (1)
- # graphql (36)
- # hoplon (4)
- # jobs (1)
- # jobs-discuss (3)
- # juxt (2)
- # keechma (22)
- # lumo (4)
- # off-topic (1)
- # onyx (17)
- # parinfer (96)
- # protorepl (10)
- # re-frame (31)
- # reagent (14)
- # ring-swagger (17)
- # spacemacs (32)
If that’s something you’d be interested in I can start on a proposal to try and address your earlier points and open an issue when it’s ready
I'm interested to know what worries you about the approach outlined in the FAQ?
I want to be sure I understand what works and what doesn't
@mikethompson @jfntn My two cents: For most people, call-global-interceptors
would never be used and would just add complexity to grok reg-event-db and reg-event-fx. So I like the FAQ approach to make your own versions - seems straightforward enough.
so just to be sure, but using re-frame & co, what clojuscript is going to modify is only
what's in <div id="app"></div>
right?
if I have some other custom JS and other HTML in the page they should not get affected right?
I have problems for example simply integrating google maps now (but it might be something else the problem I guess it should still work)
@andrea.crotti did you check out https://github.com/Day8/re-frame/blob/master/docs/Using-Stateful-JS-Components.md ?
Or the google maps is outside the re-frame application?
ah nice I should probably do that instead
yes I was just trying to use it outside re-frame
just to get it working first
and wondering if it should still work since it should be unrelated
actually my case is even simpler than that I believe
since I just want to show the map with a marker on
and actually I think I'll just be lazy and use https://hpneo.github.io/gmaps/examples.html
the actual div id="map"
is still injected by clojurescript anyway
and I control the CSS for that as well
so since I don't need data back from the map it's much simpler this way I think
is it a big sin if I combine some server side rendering with re-frame?
just for a few things I want to inject in the very few pure JS bits
Does anyone know if there is a way to get components with local state to maintain that local state after a hot reload? For example, this component:
(defn LocalStateComponent
[]
(let [count (reagent.ratom/atom 0)]
(fn []
[:div
@count
[:button {:on-click #(swap! count inc)} "inc"]])))
will reset to 0 after hot reloading. Is there a solution to this?how do people do localization (just two languages really) with re-frame?
I found this https://github.com/tonsky/tongue which is pretty good
the only annoying thing however is that I have to carry the current language all over the place (I'm storing it in the db atom)
and somehow pre-pend every single string to make sure it's localised
I guess there must be better ways to do that?
the only other alternative I see would be have a function that transforms nested data structures representing my components
that goes deep into them and translates everything that way, which however seems a bit hard to do as well