From 1e409d541dac2ab0e14c6be43d921913606dab5b Mon Sep 17 00:00:00 2001 From: Lucio D'Alessandro Date: Sun, 5 Jan 2020 23:56:07 +0000 Subject: [PATCH] Make component-did-mount optional --- README.md | 2 +- project.clj | 2 +- src/fork/core.cljs | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4e62538..35d3799 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ As at this state you must be dying of curiosity, I will dive right into the code #### In Deps ```clojure -fork {:mvn/version "1.2.2"} +fork {:mvn/version "1.2.3"} ``` or diff --git a/project.clj b/project.clj index 3c06e10..a028a93 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject fork "1.2.2" +(defproject fork "1.2.3" :description "Reagent & Re-Frame form library" :url "https://github.com/luciodale/fork" :license {:name "MIT"} diff --git a/src/fork/core.cljs b/src/fork/core.cljs index fc68104..409830c 100644 --- a/src/fork/core.cljs +++ b/src/fork/core.cljs @@ -28,7 +28,8 @@ :path (:path props)})))}] (r/create-class {:component-did-mount - #((:component-did-mount props) handlers) + #(when-let [on-mount (:component-did-mount props)] + (on-mount handlers)) :component-will-unmount (fn [] (when (:clean-on-unmount? props)