;; ============================================================================= | |
;; Composite | |
(def composite-data | |
{:composite/item {:id 0 | |
:width 400 | |
:height 400 | |
:color "#428BCA" | |
:children [{:id 1 | |
:width 200 |
**Concerns | |
- Interactivity | |
-- Incremental extension or modification of running system | |
- Modularity | |
-- Pluggable serialization, storage, conveyance, scheduling, lifecycle hooks etc etc | |
**Spark Summary | |
- RDDs: represent a lazily-computed distributed dataset | |
-- each dataset is broken up into 'partitions' that individually sit at different machines | |
-- just a DAG with edges annotated to describe relationship between partitions of parent and partitions of child |
Integrating third party JavaScript libraries not written with Google Closure Compiler in mind continues to both be a source of error for users when going to production, and significant vigilance and effort for the the broader community (CLJSJS libraries must provide up-to-date and accurate externs).
In truth writing externs is far simpler than most users imagine. You only need externs for the parts of the library you actually intend to use from ClojureScript. However this isn't so easy to determine from Closure's own documentation. Still in the process of writing your code it's easy to miss a case. In production you will see the much dreaded error that some mangled name does not exist. Fortunately it's possible to enable some compiler flags :pretty-print true :pseudo-names true
to generate an advanced build with human readable names. However debugging missing externs means compiling your production build for each missed case. So much time wasted for such simple mistakes damages our sen
(require | |
'[cemerick.url :as url] | |
'[clojure.spec.alpha :as s] | |
'[clojure.spec.gen.alpha :as sgen]) | |
(defn non-empty-string-alphanumeric | |
[] | |
(sgen/such-that #(not= "" %) | |
(sgen/string-alphanumeric))) |
(ns ucv.models.user | |
(:require #?@(:clj [[datomic.api :as d] | |
[ucv.util :as util :refer [spy when-clj]]] | |
:cljs [[ucv.auth :as auth] | |
[ucv.util :as util :refer-macros [spy when-clj]]]) | |
[clojure.spec.alpha :as s] | |
[taoensso.timbre :as log] | |
[fulcro.client.primitives :as prim :refer [defsc]] | |
[ucv.util :as util] |
(defn cache-resolver [resolver] | |
(update resolver ::pc/resolve | |
(fn [resolve] | |
(fn [{::keys [persistent-cache*] :as env} input] | |
(let [cache-key [(::pc/sym resolver) input (p/params env)]] | |
(if-let [[_ v] (find @persistent-cache* cache-key)] | |
v | |
(let [response (resolve env input)] | |
(swap! persistent-cache* assoc cache-key response) | |
response))))))) |