Skip to content

Commit

Permalink
use re-frame 0.8.0 in reagent6 template
Browse files Browse the repository at this point in the history
  • Loading branch information
drapanjanas committed Aug 7, 2016
1 parent a61dc5d commit e52b9cd
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
4 changes: 2 additions & 2 deletions re-natal.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ interfaceConf =
sources:
ios: ["core.cljs"]
android: ["core.cljs"]
common: ["handlers.cljs", "subs.cljs", "db.cljs"]
common: ["events.cljs", "subs.cljs", "db.cljs"]
other: [["reagent_dom.cljs","reagent/dom.cljs"], ["reagent_dom_server.cljs","reagent/dom/server.cljs"]]
deps: ['[reagent "0.6.0-rc" :exclusions [cljsjs/react cljsjs/react-dom cljsjs/react-dom-server]]'
'[re-frame "0.7.0"]']
'[re-frame "0.8.0-alpha9"]']
shims: ["cljsjs.react", "cljsjs.react.dom", "cljsjs.react.dom.server"]
sampleCommandNs: '(in-ns \'$PROJECT_NAME_HYPHENATED$.ios.core)'
sampleCommand: '(dispatch [:set-greeting "Hello Native World!"])'
Expand Down
2 changes: 1 addition & 1 deletion resources/cljs-reagent6/core.cljs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(ns $PROJECT_NAME_HYPHENATED$.$PLATFORM$.core
(:require [reagent.core :as r :refer [atom]]
[re-frame.core :refer [subscribe dispatch dispatch-sync]]
[$PROJECT_NAME_HYPHENATED$.handlers]
[$PROJECT_NAME_HYPHENATED$.events]
[$PROJECT_NAME_HYPHENATED$.subs]))

(def ReactNative (js/require "react-native"))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(ns $PROJECT_NAME_HYPHENATED$.handlers
(ns $PROJECT_NAME_HYPHENATED$.events
(:require
[re-frame.core :refer [register-handler after]]
[re-frame.core :refer [reg-event after]]
[cljs.spec :as s]
[$PROJECT_NAME_HYPHENATED$.db :as db :refer [app-db]]))

Expand All @@ -22,13 +22,13 @@

;; -- Handlers --------------------------------------------------------------

(register-handler
(reg-event
:initialize-db
validate-spec-mw
(fn [_ _]
app-db))

(register-handler
(reg-event
:set-greeting
validate-spec-mw
(fn [db [_ value]]
Expand Down
8 changes: 3 additions & 5 deletions resources/cljs-reagent6/subs.cljs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
(ns $PROJECT_NAME_HYPHENATED$.subs
(:require-macros [reagent.ratom :refer [reaction]])
(:require [re-frame.core :refer [register-sub]]))
(:require [re-frame.core :refer [reg-sub]]))

(register-sub
(reg-sub
:get-greeting
(fn [db _]
(reaction
(get @db :greeting))))
(:greeting db)))

0 comments on commit e52b9cd

Please sign in to comment.