• neverstew avatar
    deleteVal
    @neverstew
    An interactive, runnable TypeScript val by neverstew
    Script
  • nbbaier avatar
    fetchPaginatedData
    @nbbaier
    Fetch Paginated Data This val exports a function that loops through paginated API responses and returns the combined data as an array. It expects pagination with next and there to be a data property in the API response. This conforms to the Val Town API, so this function is useful when fetching paginated Val Town API responses for creating custom folders in pomdtr's vscode extension . Usage: const id = <vt user id> await fetchPaginatedData(`https://api.val.town/v1/users/${id}/vals`, { headers: { Authorization: `Bearer ${Deno.env.get("valtown")}` }, }); For demo usage in the context of the vscode extension see this val .
    Script
1
Next
v14
March 1, 2024