mirror of
https://github.com/penpot/penpot.git
synced 2025-04-08 13:01:24 -05: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]
|
||||
[: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…
Add table
Reference in a new issue