From ea600971535124eba5f1301a197746da7a0a5c8c Mon Sep 17 00:00:00 2001 From: "Tristan B. Velloza Kildaire" Date: Wed, 22 Feb 2023 16:57:00 +0200 Subject: [PATCH] Added usage of the `then` call --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 870f6c0..59a2188 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,17 @@ Eventy eventy = new Eventy(); */ Promise myPromise = eventy.new((x) => (x*2)); +/** + * Chain a promise to this one such that upon completion of + * `myPromise` then `promise2` will run and `myPromise` will only + * be considered completely done once everything from its chain forward is + * + * NOTE: That a promise is only completed then once its chain forwards + * is completed + */ +Promise promise2 = eventy.new((x)=>()); +myPromise.then(promise2); + /** * Now start the promise and await its completion, * this will basically sleep the calling thread