re-frisk new features
This commit is contained in:
parent
4022bea1d0
commit
4e31d76049
|
@ -2,7 +2,8 @@
|
|||
(:require [reagent.core :as r]
|
||||
[re-frisk-remote.core :as rr]
|
||||
[status-im.android.core :as core]
|
||||
[figwheel.client :as figwheel :include-macros true]))
|
||||
[figwheel.client :as figwheel :include-macros true]
|
||||
[status-im.utils.handlers :as utils.handlers]))
|
||||
|
||||
(enable-console-print!)
|
||||
|
||||
|
@ -19,4 +20,6 @@
|
|||
:heads-up-display false
|
||||
:jsload-callback callback)
|
||||
|
||||
(rr/enable-re-frisk-remote! {:host "localhost:4567" :on-init core/init :pre-send (fn [db] (update db :chats #(into {} %)))})
|
||||
(utils.handlers/add-pre-event-callback rr/pre-event-callback)
|
||||
|
||||
(rr/enable-re-frisk-remote! {:host "10.0.3.2:4567" :on-init core/init})
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
(:require [reagent.core :as r]
|
||||
[re-frisk-remote.core :as rr]
|
||||
[status-im.ios.core :as core]
|
||||
[status-im.utils.handlers :as utils.handlers]
|
||||
[figwheel.client :as figwheel :include-macros true]
|
||||
[cljs.pprint]))
|
||||
|
||||
|
@ -16,4 +17,6 @@
|
|||
:heads-up-display false
|
||||
:jsload-callback #(swap! cnt inc))
|
||||
|
||||
(rr/enable-re-frisk-remote! {:host "localhost:4567" :on-init core/init :pre-send (fn [db] (update db :chats #(into {} %)))})
|
||||
(utils.handlers/add-pre-event-callback rr/pre-event-callback)
|
||||
|
||||
(rr/enable-re-frisk-remote! {:host "localhost:4567" :on-init core/init})
|
|
@ -13,7 +13,7 @@
|
|||
[com.cognitect/transit-cljs "0.8.243"]]
|
||||
:plugins [[lein-cljsbuild "1.1.7"]
|
||||
[lein-figwheel "0.5.13"]
|
||||
[lein-re-frisk "0.5.2"]]
|
||||
[lein-re-frisk "0.5.4"]]
|
||||
:clean-targets ["target/" "index.ios.js" "index.android.js"]
|
||||
:aliases {"prod-build" ^{:doc "Recompile code with prod profile."}
|
||||
["do" "clean"
|
||||
|
@ -23,8 +23,8 @@
|
|||
"test-protocol" ["with-profile" "test" "doo" "node" "protocol" "once"]}
|
||||
:figwheel {:nrepl-port 7888}
|
||||
:profiles {:dev {:dependencies [[figwheel-sidecar "0.5.11"]
|
||||
[re-frisk-remote "0.5.0"]
|
||||
[re-frisk-sidecar "0.5.2"]
|
||||
[re-frisk-remote "0.5.2"]
|
||||
[re-frisk-sidecar "0.5.3"]
|
||||
[com.cemerick/piggieback "0.2.2"]
|
||||
[hawk "0.2.11"]]
|
||||
:source-paths ["src" "env/dev"]
|
||||
|
|
|
@ -6,6 +6,11 @@
|
|||
[taoensso.timbre :as log])
|
||||
(:require-macros status-im.utils.handlers))
|
||||
|
||||
(def pre-event-callback (atom nil))
|
||||
|
||||
(defn add-pre-event-callback [callback]
|
||||
(reset! pre-event-callback callback))
|
||||
|
||||
(defn side-effect!
|
||||
"Middleware for handlers that will not affect db."
|
||||
[handler]
|
||||
|
@ -19,6 +24,8 @@
|
|||
:id :debug-handlers-names
|
||||
:before (fn debug-handlers-names-before
|
||||
[context]
|
||||
(when @pre-event-callback
|
||||
(@pre-event-callback (get-coeffect context :event)))
|
||||
(log/debug "Handling re-frame event: " (first (get-coeffect context :event)))
|
||||
context)))
|
||||
|
||||
|
|
Loading…
Reference in New Issue