#463 (in flight at time of writing) modifies search_content() to return a list of Connect class objects.
Right now, the best way to call existing functions that operate on Content class objects is to use purrr::map(). This is pretty simple if there are no additional arguments passed, but if additional args were required, you'd have to use R's anonymous function syntax.
# Assume `old_content` is a list of content class objects that need to be locked.
length(old_content)
# [1] 48
# Use purrr::map to apply existing functions to the list.
old_content <- purrr::map(old_content, lock_content)
# When passing extra args
old_content <- purrr::map(old_content, \(x) lock_content(x, locked_message = "R version is too old."))
It would be nicer if you could just pass the list to the functions and have it work, like so:
old_content <- lock_content(old_content, locked_message = "R version is too old.")
This might require us modifying all the content functions.
#463 (in flight at time of writing) modifies
search_content()to return a list ofConnectclass objects.Right now, the best way to call existing functions that operate on
Contentclass objects is to usepurrr::map(). This is pretty simple if there are no additional arguments passed, but if additional args were required, you'd have to use R's anonymous function syntax.It would be nicer if you could just pass the list to the functions and have it work, like so:
This might require us modifying all the content functions.