implement search bridge for swift <> cljs

This commit is contained in:
Tienson Qin
2025-11-17 23:09:44 +08:00
parent e396692f91
commit ef0235fda8
7 changed files with 159 additions and 161 deletions

View File

@@ -27,14 +27,15 @@
(show! content status clear? uid timeout nil))
([content status clear? uid timeout close-cb]
(assert (keyword? status) "status should be a keyword")
(let [contents (state/get-notification-contents)
uid (or uid (keyword (util/unique-id)))]
(state/set-state! :notification/contents (assoc contents
uid {:content content
:status status
:close-cb close-cb}))
;; (let [contents (state/get-notification-contents)
;; uid (or uid (keyword (util/unique-id)))]
;; (state/set-state! :notification/contents (assoc contents
;; uid {:content content
;; :status status
;; :close-cb close-cb}))
(when (and (not= status :error) (not (false? clear?)))
(js/setTimeout #(clear! uid) (or timeout 2000)))
;; (when (and (not= status :error) (not (false? clear?)))
;; (js/setTimeout #(clear! uid) (or timeout 2000)))
uid)))
;; uid)
))