R/response.r
js_obj.Rd
This function returns a list that jsonlite::toJSON() will always encode as {}.
jsonlite::toJSON()
{}
js_obj(x = list())
A list, or list-like object.
A list with the names attribute set.
library(webqueue) updates <- list() response(list(updates = updates)) #> HTTP/1.1 200 OK #> Content-Type: application/json; charset=utf-8 #> #> {"updates":[]} response(list(updates = js_obj(updates))) #> HTTP/1.1 200 OK #> Content-Type: application/json; charset=utf-8 #> #> {"updates":{}}