From 7c3ce0f809e9c68cfc8ca7f734cf9eab99c4d315 Mon Sep 17 00:00:00 2001 From: "eryn L. K" Date: Tue, 10 Sep 2019 17:14:24 -0400 Subject: [PATCH] Update README.md --- README.md | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index fd9e758..94aa1d4 100644 --- a/README.md +++ b/README.md @@ -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