Skip to content

Commit 2565921

Browse files
committed
Rename validating type->lifecycle
1 parent d611dbf commit 2565921

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ You can set validating type->lifecycle opt that will validate all cljfx componen
100100
:opts (cond-> {}
101101
;; Validate descriptions in dev
102102
in-development?
103-
(assoc :fx.opt/type->lifecycle @(requiring-resolve 'cljfx.dev/type->lifecycle)))))
103+
(assoc :fx.opt/type->lifecycle @(requiring-resolve 'cljfx.dev/validating-type->lifecycle)))))
104104

105105
(defn -main []
106106
(fx/mount-renderer state renderer))
@@ -125,7 +125,7 @@ You can set validating type->lifecycle opt that will validate all cljfx componen
125125
;; at cljfx.dev$wrap_lifecycle$reify__22150.advance(validation.clj:80)
126126
;; at ...
127127
```
128-
If you already use custom type->lifecycle opt, instead of using `cljfx.dev/type->lifecycle` you can use `cljfx.dev/wrap-type->lifecycle` to wrap your type->lifecycle with validations.
128+
If you already use custom type->lifecycle opt, instead of using `cljfx.dev/validating-type->lifecycle` you can use `cljfx.dev/wrap-validating-type->lifecycle` to wrap your type->lifecycle with validations.
129129

130130
Additionally, you can validate individual descriptions while developing:
131131
```clojure

src/cljfx/dev.clj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@
319319

320320
(load "dev/validation")
321321

322-
(defn wrap-type->lifecycle
322+
(defn wrap-validating-type->lifecycle
323323
"Wrap type->lifecycle used in the cljfx UI app with improved error messages
324324
325325
Wrapped lifecycle performs spec validation of cljfx descriptions that results
@@ -333,16 +333,16 @@
333333
type->id custom type->id if you need a way to get id from your
334334
custom lifecycles"
335335
([type->lifecycle]
336-
(wrap-type->lifecycle type->lifecycle *type->id*))
336+
(wrap-validating-type->lifecycle type->lifecycle *type->id*))
337337
([type->lifecycle type->id]
338338
(let [f (memoize wrap-lifecycle)]
339339
(fn [type]
340340
(f type type->lifecycle type->id)))))
341341

342-
(def type->lifecycle
342+
(def validating-type->lifecycle
343343
"Default type->lifecycle that can be used in the cljfx UI app to improve error
344344
messages"
345-
(wrap-type->lifecycle (some-fn fx/keyword->lifecycle fx/fn->lifecycle)))
345+
(wrap-validating-type->lifecycle (some-fn fx/keyword->lifecycle fx/fn->lifecycle)))
346346

347347
(defn explain-desc
348348
"Validate cljfx description and report any issues

test/cljfx/dev_test.clj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
(defn- validated [desc]
99
@(fx/on-fx-thread
1010
(-> desc
11-
(fx/create-component {:fx.opt/type->lifecycle fx.dev/type->lifecycle})
11+
(fx/create-component {:fx.opt/type->lifecycle fx.dev/validating-type->lifecycle})
1212
fx/instance)))
1313

1414
(deftest create-test
@@ -29,7 +29,7 @@
2929
:text "a string"}]}))))
3030

3131
(deftest advance-test
32-
(let [opts {:fx.opt/type->lifecycle fx.dev/type->lifecycle}
32+
(let [opts {:fx.opt/type->lifecycle fx.dev/validating-type->lifecycle}
3333
c (fx/create-component
3434
{:fx/type :label
3535
:text "foo"}
@@ -65,7 +65,7 @@
6565
old-err System/err]
6666
(System/setErr err)
6767
@(fx/on-fx-thread
68-
(let [opts {:fx.opt/type->lifecycle fx.dev/type->lifecycle}
68+
(let [opts {:fx.opt/type->lifecycle fx.dev/validating-type->lifecycle}
6969
c (fx/create-component
7070
{:fx/type :stage
7171
:showing true

0 commit comments

Comments
 (0)