-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow passing parameters to custom panels #6
Comments
|
out of these, I would prefer 3, then 4, both 2 & 1 seem hacks to me. 1) partial(dev-tools/start!
{:state-atom re-frame.db/app-db
:panels-fn {:permissions {:label "Permissions" :fn (partial permissions-view {:permissions #{:a :b}})}}}) 2) reuse whole panel submap(dev-tools/start!
{:state-atom re-frame.db/app-db
:panels-fn {:permissions (permissions-panel-info {:permissions #{:a :b}})}}}) 3) support reagent syntax(dev-tools/start!
{:state-atom re-frame.db/app-db
:panels-fn {:permissions {:label "Permissions" :fn [permission-view {:permissions #{:a :b}}]}}})
;; rename keys
(dev-tools/start!
{:state-atom re-frame.db/app-db
:panels {:permissions {:label "Permissions" :view [permission-view {:permissions #{:a :b}}]}}}) 4) single options map(dev-tools/start!
{:state-atom re-frame.db/app-db
:data {:permissions #{:a :b}}
:panels-fn {:permissions {:label "Permissions" :fn permissions-view}}}) |
|
I wonder if I had some reason why the option is Might be related to the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
2) like 1, but just one key, e.g. :data
3) something else
The text was updated successfully, but these errors were encountered: