From 1c987f2eb48c9956def82f7ffd26b9c267a7c4d9 Mon Sep 17 00:00:00 2001 From: "eryn L. K" Date: Mon, 27 Dec 2021 22:24:39 -0500 Subject: [PATCH] Remove code example from readme --- README.md | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/README.md b/README.md index 33ff954..48233f8 100644 --- a/README.md +++ b/README.md @@ -20,34 +20,3 @@ This Promise implementation attempts to satisfy these traits: * An object that represents a unit of asynchronous work * Composability * Predictable timing - -## Example -`Promise.new` returns synchronously. - -``` -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) - local result = HttpService:JSONDecode(HttpService:GetAsync(url)) - - if result.ok then - resolve(result.data) - else - reject(result.error) - end - end) -end - --- Usage -httpGet("https://some-api.example") - :andThen(function(body) - print("Here's the web api result:", body) - end) - :catch(function(err) - warn("Web api encountered an error:", err) - end) -``` -