Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Re-frame playground
(ns instructions.core
(:require [reagent.dom :as dom]
[re-frame.core :as re-frame]))
(defn info []
[:div {:style {:max-width 500}}
[:h1 "re-playground"]
[:p "code is livereloaded.
this right-hand panel has the id 'app'.
to render reagent into this panel, target this element with "
[:code "(js/document.getElementById 'app')"]
". see the "
[:a {:href "?gist-id=daiyi/6ca3d5fd72c3d79b3f1e77cb754006b5"} "examples"]
"!"]
[:h2 "load from gist"]
[:p "to easily share re-frame sketches, you can save your code to a "
[:a {:href "https://gist.github.com"} "github gist"]
" and load it into this editor with the url param: "
[:code "gist-id=[github-username]/[gist-id]"]]
[:p "for example: " [:a {:href "?gist-id=daiyi/62db9d22136503a42cbbe5dc5ec0337d"} "?gist-id=daiyi/62db9d22136503a42cbbe5dc5ec0337d"]]])
;; This renders the app to the right-hand panel
(dom/render
[info]
(js/document.getElementById "app"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment