Skip to content

Instantly share code, notes, and snippets.

@daiyi
Last active July 24, 2017 12:58
Show Gist options
  • Save daiyi/6ca3d5fd72c3d79b3f1e77cb754006b5 to your computer and use it in GitHub Desktop.
Save daiyi/6ca3d5fd72c3d79b3f1e77cb754006b5 to your computer and use it in GitHub Desktop.
(ns demos.core
(:require [reagent.core :as reagent]))
(def demo-list [{:url "?gist-id=daiyi/77dce421a5fb59db71893b6727e92010"
:text "hello world"}
{:url "?gist-id=saskali/1398f41345ea4df551b0c370ac1ac822"
:text "timer"}
{:url "/"
:text "to-do list"}])
(defn demos [links]
[:ul
(for [link links]
^{:key link} [:li
[:a {:href (:url link)}
(:text link)]])])
(defn ui []
[:div
[:h1 "re-frame demos"]
[:p "Try writing some re-frame with reagent starting with a "
[:a {:href "?gist-id=daiyi/62db9d22136503a42cbbe5dc5ec0337d"}
"template"]
", or investigate one of these demos!"]
[demos demo-list]])
(reagent/render
[ui]
(js/document.getElementById "app"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment