Skip to content

Instantly share code, notes, and snippets.

@polymeris
Created December 2, 2018 18:52
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save polymeris/0112389243890709108c4b8b0a186f46 to your computer and use it in GitHub Desktop.
Save polymeris/0112389243890709108c4b8b0a186f46 to your computer and use it in GitHub Desktop.
proton-native in clojurescript via reagent
;; Add the following to cljsbuild :compiler options
;; :npm-deps {:proton-native "1.1.10"}
;; :install-deps true
(ns hello-proton-native.core
(:require [cljs.nodejs :as nodejs]
[reagent.core :as reagent]
["proton-native" :as proton :refer [App Window Button]]))
(nodejs/enable-util-print!)
(defn example [{:keys [args]}]
[:> App
[:> Window {:title "Example"}
[:> Button "Button"]]])
(defn -main [& args]
(-> (reagent/reactify-component example)
(reagent/create-element #js {:args args})
(proton/render)))
(set! *main-cli-fn* -main)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment