metosin / metosin/reagent-dev-tools
allow passing parameters to custom panels
- Dominant language
- Clojure
- Stars
- 23
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
currently the panel-functions are 0-arity. To write reusable panels, there should be a way to pass parameters to them. Few suggestions:
## 1) pass the start! options to panels
```clj
(defn permissions-view [{:keys [permissions]}]
...)
(dev-tools/start!
{:state-atom re-frame.db/app-db
:permissions #{:a :b}
:panels-fn {:permissions {:label "Permissions" :fn permissions-view}}})
```
## 2) like 1, but just one key, e.g. :data
```clj
(dev-tools/start!
{:state-atom re-frame.db/app-db
:data {:permissions #{:a :b}}
:panels-fn {:permissions {:label "Permissions" :fn permissions-view}}})
```
## 3) something else
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at dev-tools/start! and trace how :panels-fn currently invokes 0-arity panel functions. Compare the proposed ways to pass start! options or a data key, then establish which API should be supported. Done means custom panels can receive parameters through a documented, agreed interface.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- clojure
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100