From 3b72c0cfdcbb3f4cfe59918236e1d9aefa5bd0a6 Mon Sep 17 00:00:00 2001 From: Andrej Rasevic <andrej@rasevicengineering.com> Date: Fri, 24 Jun 2022 09:25:19 -0400 Subject: [PATCH] updating newFetch example --- lectureExamples/newFetch.html | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/lectureExamples/newFetch.html b/lectureExamples/newFetch.html index aa9e090..1f8affd 100644 --- a/lectureExamples/newFetch.html +++ b/lectureExamples/newFetch.html @@ -32,15 +32,41 @@ }) } + let prom = new Promise((resolve, reject) => { + resolve('I am running in the initial tick') + }) + + new Promise((resolve, reject) => { + resolve('testing a theory') + }).then(message => { + console.log(message) + }).then((value) => { + console.log('showing interleaveing') + }) let result = newFetch(data) newFetch(data) .then(result => { - console.log('printing from newFetch') + setTimeout(() => { + console.log('printing from newFetch')} + , 1000) console.log(result) + }) + .then(() => { + console.log('always will grint before "printing from newFetch" ') }) .catch(err => console.error(err)) + + console.log('at the bottom of the script') + prom + .then((message) => { + console.log(message) + return "this will be wrapped" + }) + .then(message => { + console.log(message) + }) </script> </body> -- GitLab