Skip to content
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

views: customize rendering of prop-values #10

Open
divs1210 opened this issue Sep 24, 2018 · 0 comments
Open

views: customize rendering of prop-values #10

divs1210 opened this issue Sep 24, 2018 · 0 comments

Comments

@divs1210
Copy link
Contributor

divs1210 commented Sep 24, 2018

We don't always want our prop-values to be rendered as plaintext:

  • urls should be clickable
  • images should be displayed
  • etc.

Currently, the view calls (str prop-value).
This could be replaced with something like (render-prop prop-value), where render-prop is a fn/protocol/multimethod that returns hiccup.

This fn could either be passed as part of the :view map passed to re-crud.components/show, where the default could be str, or we could define a multimethod to automatically dispatch based on the type of the prop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant