r-lib / gh

Minimalistic GitHub API client in R
https://gh.r-lib.org
Other
223 stars 52 forks source link

add vctrs methods to make rectangling nicer #201

Open tanho63 opened 2 months ago

tanho63 commented 2 months ago

Closes #161 as part of tidy dev day:

Adds vctrs methods provided by @DavisVaughan to help gh_response play more nicely with vctrs rectangling toolkit.

test instructions:

pkgload::load_all()
x <- gh("/users", .limit = 2)
Sys.sleep(1)
y <- gh("/users", .limit = 2)

str(vctrs::vec_c(x, y), list.len = 3)

list(x, y) |> 
  tibble::tibble() |> 
  tidyr::unnest_longer(1)
hadley commented 2 months ago

Could you include a simple test case too? I think using vec_c() should be sufficient?