Update README.md

This commit is contained in:
eryn L. K 2019-09-10 17:14:24 -04:00 committed by GitHub
parent 264ff27213
commit 7c3ce0f809
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,16 +31,14 @@ local HttpService = game:GetService("HttpService")
-- A light wrapper around HttpService
-- Ideally, you do this once per project per async method that you use.
local function httpGet(url)
return Promise.new(function(resolve, reject)
Promise.spawn(function()
local ok, result = pcall(HttpService.GetAsync, HttpService, url)
return Promise.async(function(resolve, reject)
local ok, result = pcall(HttpService.GetAsync, HttpService, url)
if ok then
resolve(result)
else
reject(result)
end
end)
if ok then
resolve(result)
else
reject(result)
end
end)
end