Fork me on GitHub
#lambdaisland
<
2017-07-01
>
sakalli15:07:50

@plexus using the reagent tutorial from lambdaisland to get going building a slideshow app. a little bit stuck here trying to pass the state atom to the render function. the chestnut reagent template is changed since you did the tutorial i suspect. it now includes stuartsierras components and needs a render function defined. any pointers how to get it to work?

plexus16:07:37

@sakalli are you able to push your code to Github? I need a bit more context to see what to do...

sakalli16:07:07

not much code yet following the kanban tutorial but hacking to my needs, can paste a snippet here.

plexus16:07:16

which flags did you pass to chestnut? are you using +reagent?

plexus16:07:52

I should probably update the transcript on those episodes to use a locked version of Chestnut

plexus16:07:06

it's basically the same though, except that render is now wrapped in a method

plexus16:07:09

(ns sesame.core
  (:require [reagent.core :as r]))

(def app-state
  (r/atom ,,,))

,,,

(defn Board [state]
  [:div.board
   (for [c (:columns @state)]
     [Column c])
   [NewColumn]])

(defn render []
  (r/render [Board app-state] (js/document.getElementById "app")))

sakalli16:07:06

ok cheer! got it to work now. just a typo. thanks for your help!

sakalli16:07:14

sorry for the inconvenience.

plexus16:07:24

you're welcome! good luck with your app 😄

sakalli16:07:26

used the --reagent flag