This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-01-25
Channels
- # aleph (1)
- # announcements (6)
- # babashka (13)
- # beginners (21)
- # clj-http (25)
- # clj-kondo (23)
- # clojure (17)
- # clojure-europe (49)
- # clojure-nl (1)
- # clojure-norway (8)
- # clojure-uk (4)
- # clojuredesign-podcast (15)
- # clojurescript (6)
- # cursive (18)
- # datomic (22)
- # emacs (29)
- # hyperfiddle (55)
- # introduce-yourself (4)
- # polylith (34)
- # portal (10)
- # releases (1)
- # shadow-cljs (16)
- # spacemacs (2)
Is there a way in UI to drop individual values in the portal?
Just completely removing them
Like clearing all, but only the selected items
Currently, this can be achieved via a custom tap list:
(def tap-list (atom (with-meta (list) {:portal.viewer/default :portal.viewer/inspector})))
(defn submit [x] (swap! tap-list conj x))
(add-tap #'submit)
(defn clear-selected [& args]
(let [values (into #{} args)]
(swap! tap-list (fn [taps] (remove values taps)))))
(p/register! #'clear-selected)
(p/inspect tap-list)
(tap> :hi)
You could also implement the command in terms of the default Portal tap-list atom #'portal.runtime/tap-list
but technically that's an internal implementation detail, but I probably won't change it 😂
The other thing here is that items are removed by value, not by index since that info isn't really available to commands
Interesting, thanks! Do you think it would make sense to have it in the standard features?
I think if something can be accomplished by the user, I would rather not include it. Currently, there are certain commands that could be user added, but they were added before the ability to add your own commands and now I can't remove them.
What’s the preferred way to configure such things on user’s side?