Skip to content

Instantly share code, notes, and snippets.

View forkfork's full-sized avatar

timothy d forkfork

View GitHub Profile
local co
local fetch = function(url)
local promise = js.global:fetch(url)
promise["then"](promise, function(_, res)
local jsonPromise = res:json()
jsonPromise["then"](jsonPromise, function(_, json)
co(json)
end)
end)