Created
December 2, 2018 18:52
-
-
Save polymeris/0112389243890709108c4b8b0a186f46 to your computer and use it in GitHub Desktop.
proton-native in clojurescript via reagent
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 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