mirror of
https://github.com/penpot/penpot.git
synced 2026-04-28 04:38:14 +00:00
✨ Improve notification show params validation assertion
This commit is contained in:
parent
0900b7a572
commit
77f906ae37
@ -51,15 +51,12 @@
|
||||
[:label :string]
|
||||
[:callback ::sm/fn]]]]])
|
||||
|
||||
(def ^:private valid-notification?
|
||||
(sm/validator schema:notification))
|
||||
(def ^:private check-notification
|
||||
(sm/check-fn schema:notification))
|
||||
|
||||
(defn show
|
||||
[data]
|
||||
|
||||
(dm/assert!
|
||||
"expected valid notification map"
|
||||
(valid-notification? data))
|
||||
(assert (check-notification data) "expected valid notification map")
|
||||
|
||||
(ptk/reify ::show
|
||||
ptk/UpdateEvent
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user