Fork me on GitHub
#re-frame
<
2016-06-04
>
pataprogramming00:06:57

Hi! Looking for some assistance. I just converted some working reagent stuff over to re-frame, and events are handled, components are rendered, etc. I'm using boot's reload task. Before switching to re-frame, everything would smoothly update in the browser page after a save. After, it's no longer working. I have to manually reload the page in the browser to get it to pick up and changes to the CLJS at all.

pataprogramming00:06:49

I tried switching my render to

(reagent/render [#'depth-table]
                (by-id "content")
but no dice.

pataprogramming00:06:26

Figured it out. Can be solved by taking the approach suggested here: https://github.com/reagent-project/reagent/issues/112#issuecomment-82908212

pataprogramming01:06:47

And then changing the boot-reload task to

(reload :on-jsload 'my.namespace/mount-root)

mvaline02:06:08

so following to larger app structure reccomended in the docs, where do you guys suggest putting reusable components that will be used across multiple of my "panes"?

escherize06:06:59

has anyone successfully setup pure-frame?

escherize06:06:15

I would like to get devcards working with re-frame

escherize06:06:23

I guess I havn't found the docs ( https://github.com/binaryage/pure-frame ) super helpful

escherize06:06:11

So far I have setup a Frame with some handlers and subscriptions

escherize06:06:30

(def frame-handlers
  {:initialize-db
   (fn  [_ _] db/default-db)

   :set-kv
   (fn [db [_ k v]] (assoc db k v))})

(def frame-subs
  {:name (fn [db]
           (reaction (:name @db)))})

(def app-db (pure-frame/make-frame frame-handlers frame-subs))

caio15:06:33

@mccraigmccraig: can you take a look and tell me what you think? https://github.com/caioaao/re-interval I didn’t even tested it with re-frame, so idk if the event handling is working

richiardiandrea15:06:48

Nice @caio! Btw in Clojure i really like https://github.com/jarohen/chime maybe it can be posted to Clojurescript as well

caio18:06:11

yeah, chime seems really cool. unfortunately it’s something highly dependent on joda.time. my idea was to build sth as simple as possible and that also worked with react-native (not even some clojurescript libraries work very well with it)

caio23:06:58

now it’s tested and it’s working 😄 (no unit tests written tho, don’t know how to test it)