Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify ns declaration #14

Merged
merged 4 commits into from Sep 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions dev.cljs.edn
@@ -1,5 +1,6 @@
{:main cljs-spa.core
:npm-deps false ;; this is important!
:language-out :ecmascript5 ;; see https://dev.clojure.org/jira/browse/CLJS-2376
:output-to "target/public/compiled/app.js"
:foreign-libs [{:file "./doublebundle/dist/doublebundle.js",
:provides ["react" "react-dom" "create-react-class" "react-dom/server"
Expand Down
8 changes: 5 additions & 3 deletions src/cljs_spa/page/home.cljs
@@ -1,14 +1,16 @@
(ns cljs-spa.page.home
(:require [react-select :as react-select]
[cljs-spa.state :refer [!state]]))
(:require
;; See https://github.com/pesterhazy/cljs-spa-example/issues/13
[react-select :refer [default] :rename {default react-select}]
[cljs-spa.state :refer [!state]]))

(def options
[{:value "simplicity" :label "simplicity"}
{:value "immutable data" :label "immutable data"}
{:value "lazy sequences" :label "lazy sequences"}])

(defn selector-ui []
[:> (.-default react-select)
[:> react-select
{:is-multi true
:options (clj->js options)
:on-change (fn [xs] (swap! !state assoc :selection
Expand Down