rename project

This commit is contained in:
Gered 2016-05-31 10:47:22 -04:00
parent 9e85b571f4
commit 8cc6e69314
22 changed files with 85 additions and 84 deletions

View file

@ -1,15 +1,16 @@
# reagent-data-views # views.reagent
Reagent components that can subscribe to receive realtime database updates. [Reagent][1] support for the [views][2] library, allowing Reagent components to
reactively re-render based on server-side changes.
[1]: https://github.com/reagent-project/reagent
[2]: https://github.com/gered/views
### This library is still in the experimental stages! ### ### This library is still in the experimental stages! ###
I'm hoping to have a release with documentation and examples soon. For now, tread I'm hoping to have a release with documentation and examples soon. For now, tread
carefully when browsing through the code in this repository! carefully when browsing through the code in this repository!
This requires the use of my fork of the [views](https://github.com/gered/views) library
(which is also currently in the experimental stage).
## License ## License
Copyright © 2016 Gered King Copyright © 2016 Gered King

View file

@ -1,4 +1,4 @@
# Reagent Data Views Example - Class Registry # views.reagent Example - Class Registry
This is a "Class Registry" application that has a lot of CRUD operations This is a "Class Registry" application that has a lot of CRUD operations
in it which allow users to manage students and professors, as well as in it which allow users to manage students and professors, as well as
@ -15,20 +15,20 @@ using parameters).
Definitely take a look at the [TodoMVC][1] example app before diving into Definitely take a look at the [TodoMVC][1] example app before diving into
this and also be sure you're familiar with Reagent. this and also be sure you're familiar with Reagent.
[1]: https://github.com/gered/reagent-data-views/tree/master/examples/todomvc [1]: https://github.com/gered/views.reagent/tree/master/examples/todomvc
## Running ## Running
### A quick note on the dependencies used ### A quick note on the dependencies used
Since Reagent Data Views and the Views library it depends on are all Since views.reagent and the Views library it depends on are all
currently in somewhat of an experimental / pre-beta state right now, currently in somewhat of an experimental / pre-beta state right now,
you will need to first clone the following repositories and manually you will need to first clone the following repositories and manually
install the libraries via `lein install`: install the libraries via `lein install`:
* [views](https://github.com/gered/views) * [views](https://github.com/gered/views)
* [views-sql](https://github.com/gered/views-sql) * [views-sql](https://github.com/gered/views-sql)
* [reagent-data-views](https://github.com/gered/reagent-data-views) * [views.reagent](https://github.com/gered/views.reagent)
As well, you can install [views-honeysql](https://github.com/gered/views-honeysql) As well, you can install [views-honeysql](https://github.com/gered/views-honeysql)
if you want to try out using HoneySQL instead of SQL with views. But if you want to try out using HoneySQL instead of SQL with views. But

View file

@ -13,8 +13,8 @@
[gered/clj-browserchannel-immutant-adapter "0.0.3"] [gered/clj-browserchannel-immutant-adapter "0.0.3"]
[gered/views "1.5-SNAPSHOT"] [gered/views "1.5-SNAPSHOT"]
[gered/views-sql "0.1.0-SNAPSHOT"] [gered/views-sql "0.1.0-SNAPSHOT"]
[reagent-data-views "0.2.0-SNAPSHOT"] [views.reagent "0.2.0-SNAPSHOT"]
[reagent-data-views-browserchannel "0.1.0-SNAPSHOT"] [views.reagent.browserchannel "0.1.0-SNAPSHOT"]
[hiccup "1.0.5"] [hiccup "1.0.5"]
[reagent "0.6.0-alpha2"] [reagent "0.6.0-alpha2"]

View file

@ -4,10 +4,10 @@
[reagent.core :as r] [reagent.core :as r]
[ajax.core :refer [POST default-interceptors to-interceptor]] [ajax.core :refer [POST default-interceptors to-interceptor]]
[net.thegeez.browserchannel.client :as browserchannel] [net.thegeez.browserchannel.client :as browserchannel]
[reagent-data-views.client.component :refer [view-cursor] :refer-macros [defvc]] [views.reagent.client.component :refer [view-cursor] :refer-macros [defvc]]
[reagent-data-views.browserchannel.client :as rdv])) [views.reagent.browserchannel.client :as vr]))
;; Class Registry - Reagent Data Views example app ;; Class Registry - views.reagent example app
;; ;;
;; (This example app is (very) loosely based on one of the examples in the Om tutorial). ;; (This example app is (very) loosely based on one of the examples in the Om tutorial).
;; ;;
@ -350,7 +350,7 @@
"main application container" "main application container"
[] []
[:div.container-fluid [:div.container-fluid
[:h1#app-title.page-header "Class Registry " [:small "Reagent Data Views Example"]] [:h1#app-title.page-header "Class Registry " [:small "views.reagent Example"]]
[:div.row [:div.row
[:div.col-sm-6 [people]] [:div.col-sm-6 [people]]
[:div.col-sm-6 [classes]]]]) [:div.col-sm-6 [classes]]]])
@ -376,7 +376,7 @@
(defn ^:export run (defn ^:export run
[] []
(rdv/init!) (vr/init!)
(browserchannel/connect! {} {:middleware [rdv/middleware]}) (browserchannel/connect! {} {:middleware [vr/middleware]})
(r/render-component [class-registry-app] (.getElementById js/document "app"))) (r/render-component [class-registry-app] (.getElementById js/document "app")))

View file

@ -16,7 +16,7 @@
[clojure.java.jdbc :as jdbc] [clojure.java.jdbc :as jdbc]
[views.sql.core :refer [vexec! with-view-transaction]] [views.sql.core :refer [vexec! with-view-transaction]]
[views.sql.view :refer [view]] [views.sql.view :refer [view]]
[reagent-data-views.browserchannel.server :as rdv])) [views.reagent.browserchannel.server :as vr]))
(def dev? (boolean (env :dev))) (def dev? (boolean (env :dev)))
@ -141,7 +141,7 @@
[] []
(html5 (html5
[:head [:head
[:title "Class Registry"] [:title "Class Registry - views.reagent Example"]
[:meta {:name "viewport" :content "width=device-width, initial-scale=1"}] [:meta {:name "viewport" :content "width=device-width, initial-scale=1"}]
(include-css (include-css
"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"
@ -180,7 +180,7 @@
(-> app-routes (-> app-routes
(wrap-restful-format :formats [:transit-json]) (wrap-restful-format :formats [:transit-json])
(wrap-defaults (assoc-in site-defaults [:security :anti-forgery] (not dev?))) (wrap-defaults (assoc-in site-defaults [:security :anti-forgery] (not dev?)))
(wrap-browserchannel {} {:middleware [(rdv/->middleware view-system)]}) (wrap-browserchannel {} {:middleware [(vr/->middleware view-system)]})
(wrap-immutant-async-adapter))) (wrap-immutant-async-adapter)))
@ -189,7 +189,7 @@
(defn run-server (defn run-server
[] []
(rdv/init! view-system {:views views}) (vr/init! view-system {:views views})
(immutant/run handler {:port 8080})) (immutant/run handler {:port 8080}))
(defn -main (defn -main

View file

@ -1,4 +1,4 @@
# Reagent Data Views Example - Todo MVC # views.reagent Example - Todo MVC
This is a modification of the Todo MVC app for Reagent [demonstrated here][1]. This is a modification of the Todo MVC app for Reagent [demonstrated here][1].
This version of the app has been modified to use a PostgreSQL database This version of the app has been modified to use a PostgreSQL database
@ -11,14 +11,14 @@ to that data to any number of users currently viewing the app.
### A quick note on the dependencies used ### A quick note on the dependencies used
Since Reagent Data Views and the Views library it depends on are all Since views.reagent and the Views library it depends on are all
currently in somewhat of an experimental / pre-beta state right now, currently in somewhat of an experimental / pre-beta state right now,
you will need to first clone the following repositories and manually you will need to first clone the following repositories and manually
install the libraries via `lein install`: install the libraries via `lein install`:
* [views](https://github.com/gered/views) * [views](https://github.com/gered/views)
* [views-sql](https://github.com/gered/views-sql) * [views-sql](https://github.com/gered/views-sql)
* [reagent-data-views](https://github.com/gered/reagent-data-views) * [views.reagent](https://github.com/gered/views.reagent)
As well, you can install [views-honeysql](https://github.com/gered/views-honeysql) As well, you can install [views-honeysql](https://github.com/gered/views-honeysql)
if you want to try out using HoneySQL instead of SQL with views. But if you want to try out using HoneySQL instead of SQL with views. But

View file

@ -12,8 +12,8 @@
[gered/clj-browserchannel-immutant-adapter "0.0.3"] [gered/clj-browserchannel-immutant-adapter "0.0.3"]
[gered/views "1.5-SNAPSHOT"] [gered/views "1.5-SNAPSHOT"]
[gered/views-sql "0.1.0-SNAPSHOT"] [gered/views-sql "0.1.0-SNAPSHOT"]
[reagent-data-views "0.2.0-SNAPSHOT"] [views.reagent "0.2.0-SNAPSHOT"]
[reagent-data-views-browserchannel "0.1.0-SNAPSHOT"] [views.reagent.browserchannel "0.1.0-SNAPSHOT"]
[hiccup "1.0.5"] [hiccup "1.0.5"]
[reagent "0.6.0-alpha2"] [reagent "0.6.0-alpha2"]

View file

@ -3,8 +3,8 @@
[reagent.core :as r] [reagent.core :as r]
[ajax.core :refer [POST default-interceptors to-interceptor]] [ajax.core :refer [POST default-interceptors to-interceptor]]
[net.thegeez.browserchannel.client :as browserchannel] [net.thegeez.browserchannel.client :as browserchannel]
[reagent-data-views.client.component :refer [view-cursor] :refer-macros [defvc]] [views.reagent.client.component :refer [view-cursor] :refer-macros [defvc]]
[reagent-data-views.browserchannel.client :as rdv])) [views.reagent.browserchannel.client :as vr]))
;; Todo MVC - Reagent Implementation ;; Todo MVC - Reagent Implementation
;; ;;
@ -90,7 +90,7 @@
;; Main TODO app component ;; Main TODO app component
;; ;;
;; Note that this component is defined using 'defvc' instead of 'defn'. This is a ;; Note that this component is defined using 'defvc' instead of 'defn'. This is a
;; macro provided by reagent-data-views which is required to be used by any Reagent ;; macro provided by views.reagent which is required to be used by any Reagent
;; component that will directly subscribe/unsubscribe to views. It handles all the ;; component that will directly subscribe/unsubscribe to views. It handles all the
;; housekeeping operations that working with views on the client entails. ;; housekeeping operations that working with views on the client entails.
;; ;;
@ -166,15 +166,15 @@
(defn ^:export run (defn ^:export run
[] []
; Configure reagent-data-views and then BrowserChannel. ; Configure views.reagent and then BrowserChannel.
(rdv/init!) (vr/init!)
; NOTE: We are passing in an empty map for the BrowserChannel event handlers only ; NOTE: We are passing in an empty map for the BrowserChannel event handlers only
; because this todo app is not using BrowserChannel for any purpose other ; because this todo app is not using BrowserChannel for any purpose other
; then to provide client/server messaging for reagent-data-views. If we ; then to provide client/server messaging for views.reagent. If we
; wanted to use it for client/server messaging in our application as well, ; wanted to use it for client/server messaging in our application as well,
; we could pass in any event handlers we want here and it would not intefere ; we could pass in any event handlers we want here and it would not intefere
; with reagent-data-views. ; with views.reagent.
(browserchannel/connect! {} {:middleware [rdv/middleware]}) (browserchannel/connect! {} {:middleware [vr/middleware]})
(r/render-component [todo-app] (.getElementById js/document "app"))) (r/render-component [todo-app] (.getElementById js/document "app")))

View file

@ -15,7 +15,7 @@
[clojure.java.jdbc :as jdbc] [clojure.java.jdbc :as jdbc]
[views.sql.core :refer [vexec! with-view-transaction]] [views.sql.core :refer [vexec! with-view-transaction]]
[views.sql.view :refer [view]] [views.sql.view :refer [view]]
[reagent-data-views.browserchannel.server :as rdv])) [views.reagent.browserchannel.server :as vr]))
(def dev? (boolean (env :dev))) (def dev? (boolean (env :dev)))
@ -30,7 +30,7 @@
;; View system atom ;; View system atom
;; ;;
;; We just declare it, don't need to fill it with anything. The call below to ;; We just declare it, don't need to fill it with anything. The call below to
;; reagent-data-views.browserchannel.server/init-views! will take care of it. ;; views.reagent.browserchannel.server/init! will take care of it.
(defonce view-system (atom {})) (defonce view-system (atom {}))
@ -124,7 +124,7 @@
[] []
(html5 (html5
[:head [:head
[:title "todomvc with reagent"] [:title "TodoMVC - views.reagent Example"]
(include-css "todos.css" "todosanim.css") (include-css "todos.css" "todosanim.css")
(include-js "cljs/app.js")] (include-js "cljs/app.js")]
[:body [:body
@ -157,11 +157,11 @@
(wrap-defaults (assoc-in site-defaults [:security :anti-forgery] true #_(not dev?))) (wrap-defaults (assoc-in site-defaults [:security :anti-forgery] true #_(not dev?)))
; NOTE: We are passing in an empty map for the BrowserChannel event handlers only ; NOTE: We are passing in an empty map for the BrowserChannel event handlers only
; because this todo app is not using BrowserChannel for any purpose other ; because this todo app is not using BrowserChannel for any purpose other
; then to provide client/server messaging for reagent-data-views. If we ; then to provide client/server messaging for views.reagent. If we
; wanted to use it for client/server messaging in our application as well, ; wanted to use it for client/server messaging in our application as well,
; we could pass in any event handlers we want here and it would not intefere ; we could pass in any event handlers we want here and it would not intefere
; with reagent-data-views. ; with views.reagent.
(wrap-browserchannel {} {:middleware [(rdv/->middleware view-system)]}) (wrap-browserchannel {} {:middleware [(vr/->middleware view-system)]})
(wrap-immutant-async-adapter))) (wrap-immutant-async-adapter)))
@ -170,14 +170,14 @@
(defn run-server (defn run-server
[] []
; init-views! takes care of initialization of views and reagent-data-views at the same ; init! takes care of initialization of views and views.reagent at the same
; time. As a result, we do not need to also call views.core/init! anywhere. The ; time. As a result, we do not need to also call views.core/init! anywhere. The
; same arguments and options you are able to pass to views.core/init! can also be ; same arguments and options you are able to pass to views.core/init! can also be
; passed in here and they will be forwarded along, as this function is intended to be ; passed in here and they will be forwarded along, as this function is intended to be
; a drop-in replacement for views.core/init!. ; a drop-in replacement for views.core/init!.
; if you need to shutdown the views system (e.g. if you're using something like ; if you need to shutdown the views system (e.g. if you're using something like
; Component or Mount), you can just call views.core/shutdown!. ; Component or Mount), you can just call views.core/shutdown!.
(rdv/init! view-system {:views views}) (vr/init! view-system {:views views})
(immutant/run handler {:port 8080})) (immutant/run handler {:port 8080}))

View file

@ -1,6 +1,6 @@
(defproject reagent-data-views-browserchannel "0.1.0-SNAPSHOT" (defproject views.reagent.browserchannel "0.1.0-SNAPSHOT"
:description "BrowserChannel client/server support for reagent-data-views." :description "BrowserChannel client/server messaging adapter for views.reagent."
:url "https://github.com/gered/reagent-data-views" :url "https://github.com/gered/views.reagent"
:license {:name "MIT License" :license {:name "MIT License"
:url "http://opensource.org/licenses/MIT"} :url "http://opensource.org/licenses/MIT"}
@ -12,5 +12,5 @@
[org.clojure/clojurescript "1.8.51"] [org.clojure/clojurescript "1.8.51"]
[reagent "0.6.0-alpha"] [reagent "0.6.0-alpha"]
[gered/views "1.5-SNAPSHOT"] [gered/views "1.5-SNAPSHOT"]
[reagent-data-views "0.2.0-SNAPSHOT"] [views.reagent "0.2.0-SNAPSHOT"]
[gered/clj-browserchannel "0.3.1"]]}}) [gered/clj-browserchannel "0.3.1"]]}})

View file

@ -1,10 +1,10 @@
(ns reagent-data-views.browserchannel.client (ns views.reagent.browserchannel.client
(:require (:require
[net.thegeez.browserchannel.client :as browserchannel] [net.thegeez.browserchannel.client :as browserchannel]
[reagent-data-views.client.core :as client])) [views.reagent.client.core :as client]))
(defn init! (defn init!
"performs initial configuration necessary to hook browserchannel into reagent-data-views "performs initial configuration necessary to hook browserchannel into views.reagent
as the client/server messaging backend. should be called once on page load before as the client/server messaging backend. should be called once on page load before
browserchannel is initialized." browserchannel is initialized."
[] []

View file

@ -1,11 +1,11 @@
(ns reagent-data-views.browserchannel.server (ns views.reagent.browserchannel.server
(:import (:import
(clojure.lang Atom)) (clojure.lang Atom))
(:require (:require
[clojure.tools.logging :as log] [clojure.tools.logging :as log]
[net.thegeez.browserchannel.server :as browserchannel] [net.thegeez.browserchannel.server :as browserchannel]
[views.core :as views] [views.core :as views]
[reagent-data-views.server.core :as server])) [views.reagent.server.core :as server]))
(defn- views-send-fn (defn- views-send-fn
[client-id [view-sig view-data]] [client-id [view-sig view-data]]
@ -14,14 +14,14 @@
(defn init! (defn init!
"initializes the views system and adds browserchannel-specific configuration "initializes the views system and adds browserchannel-specific configuration
to it to enable the necessary hooks into reagent-data-views. to it to enable the necessary hooks into views.reagent.
this function acts as a direct replacement to calling views.core/init!, so this function acts as a direct replacement to calling views.core/init!, so
are able to initialize both views and reagent-data-views by calling this are able to initialize both views and views.reagent by calling this
function. the arguments and return value are the same as in views.core/init! function. the arguments and return value are the same as in views.core/init!
so see that function for more information. so see that function for more information.
one additional option :context-fn can be specified which is a function one additional option :context-fn can be specified which is a function
that accepts an initial context map created by reagent-data-views and that accepts an initial context map created by views.reagent and
allows your application to add any information necessary to the context allows your application to add any information necessary to the context
passed to various view system functions (such as auth-fn, namespace-fn, etc)." passed to various view system functions (such as auth-fn, namespace-fn, etc)."
([^Atom view-system options] ([^Atom view-system options]
@ -34,7 +34,7 @@
(defn ->middleware (defn ->middleware
"returns clj-browserchannel server-side event middleware for injecting "returns clj-browserchannel server-side event middleware for injecting
reagent-data-views handling into the clj-browserchannel client session views.reagent handling into the clj-browserchannel client session
lifecycle handling. simply include the returned middleware map in your lifecycle handling. simply include the returned middleware map in your
Ring handler's wrap-browserchannel options." Ring handler's wrap-browserchannel options."
[^Atom view-system] [^Atom view-system]

View file

@ -1,6 +1,6 @@
(defproject reagent-data-views-sente "0.1.0-SNAPSHOT" (defproject views.reagent.sente "0.1.0-SNAPSHOT"
:description "Sente client/server support for reagent-data-views." :description "Sente client/server messaging adapter for views.reagent."
:url "https://github.com/gered/reagent-data-views" :url "https://github.com/gered/views.reagent"
:license {:name "MIT License" :license {:name "MIT License"
:url "http://opensource.org/licenses/MIT"} :url "http://opensource.org/licenses/MIT"}
@ -12,5 +12,5 @@
[org.clojure/clojurescript "1.8.51"] [org.clojure/clojurescript "1.8.51"]
[reagent "0.6.0-alpha"] [reagent "0.6.0-alpha"]
[gered/views "1.5-SNAPSHOT"] [gered/views "1.5-SNAPSHOT"]
[reagent-data-views "0.2.0-SNAPSHOT"] [views.reagent "0.2.0-SNAPSHOT"]
[com.taoensso/sente "1.8.1"]]}}) [com.taoensso/sente "1.8.1"]]}})

View file

@ -1,6 +1,6 @@
(ns reagent-data-views.sente.client (ns views.reagent.sente.client
(:require (:require
[reagent-data-views.client.core :as client] [views.reagent.client.core :as client]
[taoensso.sente :as sente])) [taoensso.sente :as sente]))
(defonce ^:private send-buffer (atom [])) (defonce ^:private send-buffer (atom []))

View file

@ -1,10 +1,10 @@
(ns reagent-data-views.sente.server (ns views.reagent.sente.server
(:import (:import
(clojure.lang Atom)) (clojure.lang Atom))
(:require (:require
[clojure.tools.logging :as log] [clojure.tools.logging :as log]
[views.core :as views] [views.core :as views]
[reagent-data-views.server.core :as server] [views.reagent.server.core :as server]
[taoensso.sente :as sente])) [taoensso.sente :as sente]))
(defn- views-send-fn (defn- views-send-fn

View file

@ -1,6 +1,6 @@
(defproject reagent-data-views "0.2.0-SNAPSHOT" (defproject views.reagent "0.2.0-SNAPSHOT"
:description "Support for Reagent components that get pushed realtime database updates from the server." :description "Reagent support for the views library, allowing Reagent components to reactively re-render based on server-side changes."
:url "https://github.com/gered/reagent-data-views" :url "https://github.com/gered/views.reagent"
:license {:name "MIT License" :license {:name "MIT License"
:url "http://opensource.org/licenses/MIT"} :url "http://opensource.org/licenses/MIT"}

View file

@ -1,4 +1,4 @@
(ns reagent-data-views.client.component) (ns views.reagent.client.component)
(defmacro defvc (defmacro defvc
"Defines a Reagent component that works the same as any other defined "Defines a Reagent component that works the same as any other defined
@ -30,26 +30,26 @@
(reagent.core/create-class (reagent.core/create-class
{:component-will-mount {:component-will-mount
(fn [this#] (fn [this#]
(reagent-data-views.client.component/prepare-for-render! this#)) (views.reagent.client.component/prepare-for-render! this#))
:component-did-mount :component-did-mount
(fn [this#] (fn [this#]
; invoked immediately after the initial render has occurred. ; invoked immediately after the initial render has occurred.
; we do this here because component-did-mount does not get called ; we do this here because component-did-mount does not get called
; after the initial render, but will be after all subsequent renders. ; after the initial render, but will be after all subsequent renders.
(reagent-data-views.client.component/update-subscriptions! this#)) (views.reagent.client.component/update-subscriptions! this#))
:component-will-unmount :component-will-unmount
(fn [this#] (fn [this#]
(reagent-data-views.client.component/unsubscribe-all! this#)) (views.reagent.client.component/unsubscribe-all! this#))
:component-will-receive-props :component-will-receive-props
(fn [this# new-argv#] (fn [this# new-argv#]
(reagent-data-views.client.component/prepare-for-render! this#)) (views.reagent.client.component/prepare-for-render! this#))
:component-did-update :component-did-update
(fn [this# old-argv#] (fn [this# old-argv#]
(reagent-data-views.client.component/update-subscriptions! this#)) (views.reagent.client.component/update-subscriptions! this#))
:component-function :component-function
(fn ~args (fn ~args

View file

@ -1,11 +1,11 @@
(ns reagent-data-views.client.component (ns views.reagent.client.component
(:require (:require
[clojure.set :refer [difference]] [clojure.set :refer [difference]]
[reagent.core :as r] [reagent.core :as r]
[reagent.ratom :refer [RCursor]] [reagent.ratom :refer [RCursor]]
[reagent.impl.component :refer [reagent-component?]] [reagent.impl.component :refer [reagent-component?]]
[reagent-data-views.client.core :as rdv] [views.reagent.client.core :as rdv]
[reagent-data-views.client.utils :refer [update-component-state!]])) [views.reagent.client.utils :refer [update-component-state!]]))
(defn unsubscribe-all! (defn unsubscribe-all!
"Unsubscribes a component from all it's current view subscriptions. "Unsubscribes a component from all it's current view subscriptions.

View file

@ -1,7 +1,7 @@
(ns reagent-data-views.client.core (ns views.reagent.client.core
(:require (:require
[reagent.core :as r] [reagent.core :as r]
[reagent-data-views.utils :refer [relevant-event?]])) [views.reagent.utils :refer [relevant-event?]]))
(defonce ^:private first-connection? (atom true)) (defonce ^:private first-connection? (atom true))
@ -20,7 +20,7 @@
for the view corresponding with the view-sig. for the view corresponding with the view-sig.
Generally, for code in a component's render function, you should use Generally, for code in a component's render function, you should use
reagent-data-views.client.component/view-cursor instead of using this views.reagent.client.component/view-cursor instead of using this
function directly. Use of this function instead requires you to manage function directly. Use of this function instead requires you to manage
view subscription/unsubscription yourself. view subscription/unsubscription yourself.

View file

@ -1,4 +1,4 @@
(ns reagent-data-views.client.utils (ns views.reagent.client.utils
(:require (:require
[reagent.core :as r] [reagent.core :as r]
[reagent.impl.component :refer [reagent-component?]])) [reagent.impl.component :refer [reagent-component?]]))

View file

@ -1,10 +1,10 @@
(ns reagent-data-views.server.core (ns views.reagent.server.core
(:import (:import
(clojure.lang Atom)) (clojure.lang Atom))
(:require (:require
[clojure.tools.logging :as log] [clojure.tools.logging :as log]
[views.core :as views] [views.core :as views]
[reagent-data-views.utils :refer [relevant-event?]])) [views.reagent.utils :refer [relevant-event?]]))
(defn- handle-subscriptions! (defn- handle-subscriptions!
[^Atom view-system client-id view-sig context] [^Atom view-system client-id view-sig context]
@ -18,7 +18,7 @@
(defn- update-context (defn- update-context
[^Atom view-system existing-context] [^Atom view-system existing-context]
(if-let [context-fn (get-in @view-system [:reagent-data-views :context-fn])] (if-let [context-fn (get-in @view-system [:reagent :context-fn])]
(context-fn existing-context) (context-fn existing-context)
existing-context)) existing-context))
@ -43,5 +43,5 @@
(defn set-context-fn! (defn set-context-fn!
[^Atom view-system f] [^Atom view-system f]
(swap! view-system assoc-in [:reagent-data-views :context-fn] f) (swap! view-system assoc-in [:reagent :context-fn] f)
view-system) view-system)

View file

@ -1,4 +1,4 @@
(ns reagent-data-views.utils) (ns views.reagent.utils)
(defn relevant-event? (defn relevant-event?
[data] [data]