JosiahParry / youtube-tutorials

Code and slides used for youtube videos
https://josiahparry.github.io/youtube-tutorials/
12 stars 3 forks source link

rlang::inject vs do.call #15

Open JosiahParry opened 1 year ago

JosiahParry commented 1 year ago

rlang::inject() lets you inject parameters using !!! partially. Rather than having a list of arguments that you need to pass in using do.call

use case bringing this up:

  item_res <- rlang::inject(
    add_item(
      x,
      title,
      user = user,
      host = host,
      token = token,
      !!!adtl_args
    )
  )