This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-05-26
Channels
- # aws (7)
- # beginners (109)
- # boot (5)
- # carry (2)
- # cider (25)
- # clara (6)
- # cljs-dev (86)
- # cljs-experience (19)
- # cljsrn (1)
- # clojure (183)
- # clojure-dev (7)
- # clojure-dusseldorf (7)
- # clojure-gamedev (2)
- # clojure-greece (32)
- # clojure-italy (2)
- # clojure-norway (1)
- # clojure-russia (228)
- # clojure-sg (3)
- # clojure-spec (38)
- # clojure-uk (104)
- # clojurebridge (1)
- # clojurescript (29)
- # community-development (9)
- # core-async (118)
- # core-matrix (20)
- # cursive (5)
- # datomic (140)
- # emacs (25)
- # figwheel (1)
- # hoplon (21)
- # jobs (4)
- # lein-figwheel (2)
- # luminus (10)
- # lumo (35)
- # off-topic (137)
- # om (31)
- # onyx (62)
- # pedestal (6)
- # reagent (25)
- # remote-jobs (1)
- # ring-swagger (11)
- # spacemacs (2)
- # test-check (17)
- # uncomplicate (10)
- # unrepl (1)
- # untangled (20)
- # vim (4)
- # yada (3)
I've made a little app with reagent and I've been running it in dev with figwheel. How do I create a deployable production build with all the js minified, concatenated, etc?
if you've used the figwheel template (`lein new figwheel`), you can use lein cljsbuild once min
I used the reagent-frontend
template; is that similar?
Hmm I get java.lang.Exception: Unknown build identifier: min
looks like there's a "release" profile, so try lein cljsbuild once release
If I’m not using re-frame, where do I put the calls to a backend API to set up my initial app state on page load?
@jtth
There is a :init-db
event. This evento should be -fx
, and return something like
{:db {,,sutfff,,,} :dispatch [[:fetch-api :param :other] [:fetch-other-api :param :other-2]] }
ah! I’ve just been shoving stuff into the global state with session/put! like an animal. no wonder on initial page load it doesn’t work.
Are you using https://github.com/Day8/re-frame-http-fx or something like?
basically i have two api calls, one dependent on information loaded into the app state by the other, and the second one seems to fire before the first one loads into the app state
On reagent, there no standard way to manage the state of aplication.
You can, for example, declare a initial state (defonce state (r/atom {}))
Then, on main
, before render, "dispatch" your fetchs (for [i stuff] (doto fetch (js/fetch "