mirror of
https://github.com/penpot/penpot.git
synced 2025-06-11 04:41:39 +02:00
✨ Improve notification show params validation assertion
This commit is contained in:
parent
0900b7a572
commit
77f906ae37
1 changed files with 3 additions and 6 deletions
|
@ -51,15 +51,12 @@
|
||||||
[:label :string]
|
[:label :string]
|
||||||
[:callback ::sm/fn]]]]])
|
[:callback ::sm/fn]]]]])
|
||||||
|
|
||||||
(def ^:private valid-notification?
|
(def ^:private check-notification
|
||||||
(sm/validator schema:notification))
|
(sm/check-fn schema:notification))
|
||||||
|
|
||||||
(defn show
|
(defn show
|
||||||
[data]
|
[data]
|
||||||
|
(assert (check-notification data) "expected valid notification map")
|
||||||
(dm/assert!
|
|
||||||
"expected valid notification map"
|
|
||||||
(valid-notification? data))
|
|
||||||
|
|
||||||
(ptk/reify ::show
|
(ptk/reify ::show
|
||||||
ptk/UpdateEvent
|
ptk/UpdateEvent
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue