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

Consider adding is.shiny.tag() function #389

Open
daattali opened this issue Jul 21, 2023 · 2 comments
Open

Consider adding is.shiny.tag() function #389

daattali opened this issue Jul 21, 2023 · 2 comments

Comments

@daattali
Copy link
Contributor

It's fairly common for me, I'm not sure about others, to want to know whether or not a particular object is a shiny tag. This is usually done as error checking arguments in a function.

I often add the following function to my utils file:

is.shiny.tag <- function(x) {
  inherits(x, "shiny.tag")
}

Would you accept a PR to add this to {htmltools}, or would you prefer not?

@cpsievert
Copy link
Collaborator

I agree this is a pain, and would love a PR. Seems like it'd also be useful to have similar is*() functions for tagList(), HTML(), HTMLDependency()?

@daattali
Copy link
Contributor Author

I can help with tag and tagList. For HTML/dependency I don't feel comfortable writing their is function and their tests.

For tagList, should it be is.tagList?

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

2 participants