<snapdata remixID="8453535"><project name="Pinky Promises" app="Snap! 10.1-dev, https://snap.berkeley.edu" version="2"><notes>-What is a Pinky Promise? A Pinky Promise is my implementation (99% alike) of the concept of a JavaScript Promise in Snap!&#xD;-Learn about JavaScript Promises here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise&#xD;-See inside and select the Control category to see all of my Pinky Promise blocks.</notes><thumbnail>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAB4CAYAAAB1ovlvAAAAAXNSR0IArs4c6QAACslJREFUeF7tnWtMlckZx/8cBA4gclW8IYs3UPBaL6wirLhivGw0dmuru/WSGhuTjW7SZmubZptobLJJ/VBXy8dtYmvdVdoPtbGrEaULVAuoiBeytaKIgijI/QByoPlPe4hrAc+hB945zjOJOSrzzjyXn8/M88y8R7+enp4eSBMLWGQBPwHQIsvLtMoCAqCAYKkFBEBLzS+TC4DCgKUWEAAtNb9MLgAKA5ZaQAC01PwyuQAoDFhqAQHQUvPL5AKgMGCpBQRAS80vkwuAwoClFhAALTW/TC4ACgOWWkAAtNT8MrkAKAxYagEB0FLzy+QCoDBgqQUEQEvNL5MLgMKApRYQAC01v0wuAAoDllpAALTU/DK5ACgMWGoBAXAIzP/o0SN0dHQMwcgDD+nn54fRo0cjNDR02Oce7IQC4GAt18dzd+7cwYMHDzBhwgQEBAR4cWT3h3r69CmcTidmzJiB8PBw9x+0qKcA6CXDM+o9fvwYc+fOBSORla2hoQFlZWVYtmyZlWK4NbcA6JaZXt0pPz9fwTdy5EjVmQC0tra++kEv9SD0U6dORXR0tBrx1q1baimOj4/30gxDM4wA6CW7XrhwAcuXL1dLsGsZJhRcBofy+59ampvh7O5Ge3s72trawOhHOSoqKpRmCQkJXtJwaIYRAL1kVxeAjITcA7K1Njbg5gcZiA22eWmW/x3GHhyC6EN5Cr6WlhaUlJQgKysLQUFBAuCQWV3DgQlgZGQkwsLCsH//fhw8eBB/zz2LeUWfIXLJOrSVFcBxI79X8uBZa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uzDq+11dXXqRGHSpEluccTox7t5EvXcMpfqJAD2Y6umpibs3LlTXbF68uSJ+roL7uO2bdsGu93uvoWl54AWEAAHMA8LwwcOHFCnEC82nvlu375dJRkEU9rgLSAADgJA7vG2bt2qThs2bdo0eOvLk7IE98fAy0vwli1b1BK8Y8cOy75+93XkVSKgF5OQ1xGQodZJABxqC8v4koQIA/paQCKgvr4xQjIB0Ag366ukAKivb4yQTAA0ws36KikA6usbIyQTAI1ws75KCoD6+sYIyQRAI9ysr5ICoL6+MUIyAdAIN+urpACor2+MkEwANMLN+iopAOrrGyMkEwCNcLO+SgqA+vrGCMkEQCPcrK+SAqC+vjFCMgHQCDfrq6QAqK9vjJBMADTCzfoqKQDq6xsjJBMAjXCzvkoKgPr6xgjJBEAj3KyvkgKgvr4xQjIB0Ag366ukAKivb4yQTAA0ws36KikA6usbIyQTAI1ws75KCoD6+sYIyQRAI9ysr5ICoL6+MUIyAdAIN+urpACor2+MkEwANMLN+iopAOrrGyMkEwCNcLO+SgqA+vrGCMkEQCPcrK+SAqC+vjFCMgHQCDfrq6QAqK9vjJBMADTCzfoqKQDq6xsjJBMAjXCzvkoKgPr6xgjJBEAj3KyvkgKgvr4xQjIB0Ag366ukAKivb4yQTAA0ws36KikA6usbIyQTAI1ws75KCoD6+sYIyf4NATJ15Ar3newAAAAASUVORK5CYII=</thumbnail><scenes select="1"><scene name="Pinky Promises"><notes>-What is a Pinky Promise? A Pinky Promise is my implementation (99% alike) of the concept of a JavaScript Promise in Snap!&#xD;-Learn about JavaScript Promises here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise&#xD;-See inside and select the Control category to see all of my Pinky Promise blocks.</notes><hidden></hidden><headers></headers><code></code><blocks><block-definition s="safely try %&apos;action&apos; then if %&apos;error&apos; %&apos;handler&apos;" type="command" category="control"><header></header><code></code><translations>pt:tenta executar _ e, em caso de erro _ , executa _es:intentar de forma segura _ luego si _ _&#xD;</translations><inputs><input type="%cs"></input><input type="%upvar"></input><input type="%cs"></input></inputs><script><block s="doApplyExtension"><l>err_try(cmd, catch, err)</l><list><block var="action"/><block var="handler"/><block var="error"/></list></block><block s="doApplyExtension"><l>err_reset</l><list></list></block></script></block-definition><block-definition s="error %&apos;msg&apos;" type="command" category="control"><header></header><code></code><translations>pt:lança o erro _&#xD;</translations><inputs><input type="%s"></input></inputs><script><block s="doApplyExtension"><l>err_error(msg)</l><list><block var="msg"/></list></block></script></block-definition><block-definition s="let %&apos;var&apos; be %&apos;val&apos;" type="command" category="other"><header></header><code></code><translations>pt:cria a variável de guião _ com valor _&#xD;</translations><inputs><input type="%upvar"></input><input type="%s"></input></inputs><script><block s="doSetVar"><l>var</l><block var="val"/></block></script></block-definition><block-definition s="new Pinky Promise %&apos;cmnd&apos;" type="reporter" category="control" space="true"><header></header><code></code><translations>es:nueva Promesa de Meñique _&#xD;</translations><inputs><input type="%cmdRing"></input></inputs><script><custom-block s="let %upvar be %s"><l>newProm</l><block s="reportNewList"><list><l>Pinky Promise</l><l>pending</l></list></block><comment w="224" collapsed="false">I learned something:&#xD;the Promise constructor&apos;s argument&#xD;is not executed asynchronously.</comment></custom-block><custom-block s="let %upvar be %s"><l>fulfill</l><block s="reifyScript"><script><block s="doIf"><custom-block s="%l is a %s Pinky Promise?"><block var="newProm"/><l>pending</l></custom-block><script><block s="doAddToList"><block var="value"/><block var="newProm"/></block><block s="doReplaceInList"><l>2</l><block var="newProm"/><l>fulfilled</l></block></script><list></list></block></script><list><l>value</l></list></block></custom-block><custom-block s="let %upvar be %s"><l>reject</l><block s="reifyScript"><script><block s="doIf"><custom-block s="%l is a %s Pinky Promise?"><block var="newProm"/><l>pending</l></custom-block><script><block s="doAddToList"><block var="reason"/><block var="newProm"/></block><block s="doReplaceInList"><l>2</l><block var="newProm"/><l>rejected</l></block></script><list></list></block></script><list><l>reason</l></list></block></custom-block><block s="fork"><block s="reifyScript"><script><custom-block s="safely try %cs then if %upvar %cs"><script><block s="doRun"><block var="cmnd"/><list><block s="reifyScript"><script><block s="doRun"><block var="fulfill"/><list><l></l></list></block></script><list></list></block><block s="reifyScript"><script><block s="doRun"><block var="reject"/><list><l></l></list></block></script><list></list></block></list></block></script><l>error</l><script><block s="doRun"><block var="reject"/><list><block var="error"/></list></block></script></custom-block></script><list></list></block><list></list></block><block s="doReport"><block var="newProm"/></block></script></block-definition><block-definition s="new fulfilled Pinky Promise %&apos;valu&apos;" type="reporter" category="control"><header></header><code></code><translations>es:nueva Promesa lograda de Meñique _&#xD;</translations><inputs><input type="%s"></input></inputs><script><custom-block s="let %upvar be %s"><l>prom</l><custom-block s="new Pinky Promise %cmdRing"><block s="reifyScript"><script><block s="doRun"><block var="fulfill"/><list><block var="valu"/></list></block></script><list><l>fulfill</l><l>reject</l></list></block></custom-block></custom-block><block s="doWaitUntil"><custom-block s="%l is a %s Pinky Promise?"><block var="prom"/><l>fulfilled</l></custom-block></block><block s="doReport"><block var="prom"/></block></script></block-definition><block-definition s="new rejected Pinky Promise %&apos;valu&apos;" type="reporter" category="control"><header></header><code></code><translations>es:nueva Promesa rechazada de Meñique _&#xD;</translations><inputs><input type="%s"></input></inputs><script><custom-block s="let %upvar be %s"><l>prom</l><custom-block s="new Pinky Promise %cmdRing"><block s="reifyScript"><script><block s="doRun"><block var="reject"/><list><block var="valu"/></list></block></script><list><l>fulfill</l><l>reject</l></list></block></custom-block></custom-block><block s="doWaitUntil"><custom-block s="%l is a %s Pinky Promise?"><block var="prom"/><l>rejected</l></custom-block></block><block s="doReport"><block var="prom"/></block></script></block-definition><block-definition s="%&apos;prom&apos; is a %&apos;type&apos; Pinky Promise?" type="predicate" category="control"><header></header><code></code><translations>es:_ es una Promesa de Meñique _&#xD;</translations><inputs><input type="%l"></input><input type="%s" readonly="true">settled<options>pending (not done yet)=pending&#xD;fulfilled (successfully completed)=fulfilled&#xD;rejected (an error occurred)=rejected&#xD;settled (fulfilled or rejected)=settled</options></input></inputs><script><block s="doIf"><block s="reportVariadicEquals"><list><block var="type"/><l></l></list></block><script><block s="doReport"><block s="reportVariadicAnd"><list><block s="reportVariadicAnd"><list><block s="reportIsA"><block var="prom"/><l><option>list</option></l></block><block s="reportVariadicEquals"><list><block s="reportListItem"><l>1</l><block var="prom"/></block><l>Pinky Promise</l></list></block></list></block><block s="reportVariadicOr"><list><block s="reportVariadicAnd"><list><block s="reportVariadicEquals"><list><block s="reportListItem"><l>2</l><block var="prom"/></block><l>pending</l></list></block><block s="reportVariadicEquals"><list><block s="reportListAttribute"><l><option>length</option></l><block var="prom"/></block><l>2</l></list></block></list></block><block s="reportVariadicAnd"><list><block s="reportListContainsItem"><block s="reportNewList"><list><l>fulfilled</l><l>rejected</l></list></block><block s="reportListItem"><l>2</l><block var="prom"/></block></block><block s="reportVariadicEquals"><list><block s="reportListAttribute"><l><option>length</option></l><block var="prom"/></block><l>3</l></list></block></list></block></list></block></list></block></block></script><list></list></block><block s="doIf"><block s="reportVariadicEquals"><list><block var="type"/><l>pending</l></list></block><script><block s="doReport"><block s="reportVariadicAnd"><list><custom-block s="%l is a %s Pinky Promise?"><block var="prom"/><l></l></custom-block><block s="reportVariadicEquals"><list><block s="reportListItem"><l>2</l><block var="prom"/></block><l>pending</l></list></block></list></block></block></script><list></list></block><block s="doIf"><block s="reportVariadicEquals"><list><block var="type"/><l>fulfilled</l></list></block><script><block s="doReport"><block s="reportVariadicAnd"><list><custom-block s="%l is a %s Pinky Promise?"><block var="prom"/><l></l></custom-block><block s="reportVariadicEquals"><list><block s="reportListItem"><l>2</l><block var="prom"/></block><l>fulfilled</l></list></block></list></block></block></script><list></list></block><block s="doIf"><block s="reportVariadicEquals"><list><block var="type"/><l>rejected</l></list></block><script><block s="doReport"><block s="reportVariadicAnd"><list><custom-block s="%l is a %s Pinky Promise?"><block var="prom"/><l></l></custom-block><block s="reportVariadicEquals"><list><block s="reportListItem"><l>2</l><block var="prom"/></block><l>rejected</l></list></block></list></block></block></script><list></list></block><block s="doIf"><block s="reportVariadicEquals"><list><block var="type"/><l>settled</l></list></block><script><block s="doReport"><block s="reportVariadicOr"><list><custom-block s="%l is a %s Pinky Promise?"><block var="prom"/><l>fulfilled</l></custom-block><custom-block s="%l is a %s Pinky Promise?"><block var="prom"/><l>rejected</l></custom-block></list></block></block></script><list></list></block><block s="doReport"><block s="reportBoolean"><l><bool>false</bool></l></block></block></script></block-definition><block-definition s="await Pinky Promise %&apos;prom&apos;" type="reporter" category="control" space="true"><header></header><code></code><translations>es:esperar Promesa de Meñique _&#xD;</translations><inputs><input type="%l"></input></inputs><script><block s="doIfElse"><custom-block s="%l is a %s Pinky Promise?"><block var="prom"/><l></l></custom-block><script><block s="doWaitUntil"><custom-block s="%l is a %s Pinky Promise?"><block var="prom"/><l>settled</l></custom-block></block><block s="doIfElse"><custom-block s="%l is a %s Pinky Promise?"><block var="prom"/><l>fulfilled</l></custom-block><script><block s="doReport"><block s="reportListItem"><l>3</l><block var="prom"/></block></block></script><script><custom-block s="error %s"><block s="reportListItem"><l>3</l><block var="prom"/></block></custom-block></script></block></script><script><block s="doReport"><block var="prom"/></block></script></block></script></block-definition><block-definition s="Pinky Promise %&apos;prom&apos; then %&apos;cmnd&apos; , catch %&apos;hndl&apos;" type="reporter" category="control" space="true"><header></header><code></code><translations>Promesa de Meñique _ luego _ , coger:Promesa de Meñique _ luego _ , coger _&#xD;</translations><inputs><input type="%l"></input><input type="%cmdRing"></input><input type="%cmdRing"></input></inputs><script><block s="doReport"><custom-block s="new Pinky Promise %cmdRing"><block s="reifyScript"><script><custom-block s="safely try %cs then if %upvar %cs"><script><block s="doRun"><block var="fulfill"/><list><custom-block s="await Pinky Promise %l"><block var="prom"/></custom-block></list></block></script><l>error</l><script><block s="doRun"><block var="reject"/><list><block var="error"/></list></block></script></custom-block></script><list><l>fulfill</l><l>reject</l></list></block></custom-block></block></script></block-definition><block-definition s="Pinky Promise %&apos;prom&apos; catch %&apos;hndl&apos;" type="reporter" category="control"><header></header><code></code><translations>es:Promesa de Meñique _ coger _&#xD;</translations><inputs><input type="%l"></input><input type="%cmdRing"></input></inputs><script><block s="doReport"><custom-block s="Pinky Promise %l then %cmdRing , catch %cmdRing"><block var="prom"/><block s="reifyScript"><script><block s="doReport"><l></l></block></script><list></list></block><block var="hndl"/></custom-block></block></script></block-definition><block-definition s="Pinky Promise %&apos;prom&apos; finally %&apos;cmnd&apos;" type="reporter" category="control"><header></header><code></code><translations>es:Promesa de Meñique _ finalmente _&#xD;</translations><inputs><input type="%l"></input><input type="%cmdRing"></input></inputs><script><block s="doReport"><custom-block s="Pinky Promise %l then %cmdRing , catch %cmdRing"><block var="prom"/><block s="reifyScript"><script><block s="doRun"><block var="cmnd"/><list></list></block></script><list></list></block><block s="reifyScript"><script><block s="doRun"><block var="cmnd"/><list></list></block></script><list></list></block></custom-block></block></script></block-definition><block-definition s="ignore Pinky Promise %&apos;prom&apos; then %&apos;cmnd&apos; , catch %&apos;hndl&apos;" type="command" category="control" space="true"><header></header><code></code><translations>es:ignorar Promesa de Meñique _ luego _ , coger _&#xD;</translations><inputs><input type="%l"></input><input type="%cmdRing"></input><input type="%cmdRing"></input></inputs><script><custom-block s="let %upvar be %s"><l>ignore</l><custom-block s="Pinky Promise %l then %cmdRing , catch %cmdRing"><block var="prom"/><block var="cmnd"/><block var="hndl"/></custom-block></custom-block></script></block-definition><block-definition s="ignore Pinky Promise %&apos;prom&apos; catch %&apos;hndl&apos;" type="command" category="control"><header></header><code></code><translations>es:ignorar Promesa de Meñique _ coger _&#xD;</translations><inputs><input type="%l"></input><input type="%cmdRing"></input></inputs><script><custom-block s="let %upvar be %s"><l>ignore</l><custom-block s="Pinky Promise %l catch %cmdRing"><block var="prom"/><block var="hndl"/></custom-block></custom-block></script></block-definition><block-definition s="ignore Pinky Promise %&apos;prom&apos; finally %&apos;cmnd&apos;" type="command" category="control"><header></header><code></code><translations>es:ignorar Promesa de Meñique _ finalmente _&#xD;</translations><inputs><input type="%l"></input><input type="%cmdRing"></input></inputs><script><custom-block s="let %upvar be %s"><l>ignore</l><custom-block s="Pinky Promise %l finally %cmdRing"><block var="prom"/><block var="cmnd"/></custom-block></custom-block></script></block-definition><block-definition s="all of Pinky Promises %&apos;proms&apos;" type="reporter" category="control" space="true"><header></header><code></code><translations>es:todo de Promesas de Meñique _&#xD;</translations><inputs><input type="%mult%l"></input></inputs><script><block s="doReport"><custom-block s="new Pinky Promise %cmdRing"><block s="reifyScript"><script><custom-block s="let %upvar be %s"><l>pending</l><block s="reportListAttribute"><l><option>length</option></l><block var="proms"/></block></custom-block><custom-block s="let %upvar be %s"><l>vals</l><block s="reportNumbers"><l>1</l><block var="pending"/></block></custom-block><custom-block s="let %upvar be %s"><l>i</l><l>1</l></custom-block><block s="doForEach"><l>prom</l><block var="proms"/><script><block s="doRun"><block s="reifyScript"><script><custom-block s="ignore Pinky Promise %l then %cmdRing , catch %cmdRing"><block var="prom"/><block s="reifyScript"><script><block s="doReplaceInList"><block var="j"/><block var="vals"/><l></l></block><block s="doChangeVar"><l>pending</l><l>-1</l></block></script><list></list></block><block s="reifyScript"><script><block s="doSetVar"><l>vals</l><l></l></block><block s="doSetVar"><l>pending</l><l>-1</l></block></script><list></list></block></custom-block></script><list><l>j</l></list></block><list><block var="i"/></list></block><block s="doChangeVar"><l>i</l><l>1</l></block></script></block><block s="doWaitUntil"><block s="reportVariadicLessThan"><list><block var="pending"/><l>1</l></list></block></block><block s="doRun"><block s="reportIfElse"><block s="reportVariadicEquals"><list><block var="pending"/><l>0</l></list></block><block var="fulfill"/><block var="reject"/></block><list><block var="vals"/></list></block></script><list><l>fulfill</l><l>reject</l></list></block></custom-block></block></script></block-definition><block-definition s="all settled Pinky Promises %&apos;proms&apos;" type="reporter" category="control"><header></header><code></code><translations>es:todo resuelto Promesas de Meñique _&#xD;</translations><inputs><input type="%mult%l"></input></inputs><script><block s="doReport"><custom-block s="new Pinky Promise %cmdRing"><block s="reifyScript"><script><custom-block s="let %upvar be %s"><l>pending</l><block s="reportListAttribute"><l><option>length</option></l><block var="proms"/></block></custom-block><custom-block s="let %upvar be %s"><l>vals</l><block s="reportNumbers"><l>1</l><block var="pending"/></block></custom-block><custom-block s="let %upvar be %s"><l>i</l><l>1</l></custom-block><block s="doForEach"><l>prom</l><block var="proms"/><script><block s="doRun"><block s="reifyScript"><script><custom-block s="ignore Pinky Promise %l then %cmdRing , catch %cmdRing"><block var="prom"/><block s="reifyScript"><script><block s="doReplaceInList"><block var="j"/><block var="vals"/><block s="reportNewList"><list><l>fulfilled</l><l></l></list></block></block><block s="doChangeVar"><l>pending</l><l>-1</l></block></script><list></list></block><block s="reifyScript"><script><block s="doReplaceInList"><block var="j"/><block var="vals"/><block s="reportNewList"><list><l>rejected</l><l></l></list></block></block><block s="doChangeVar"><l>pending</l><l>-1</l></block></script><list></list></block></custom-block></script><list><l>j</l></list></block><list><block var="i"/></list></block><block s="doChangeVar"><l>i</l><l>1</l></block></script></block><block s="doWaitUntil"><block s="reportVariadicEquals"><list><block var="pending"/><l>0</l></list></block></block><block s="doRun"><block var="fulfill"/><list><block var="vals"/></list></block></script><list><l>fulfill</l><l>reject</l></list></block></custom-block></block></script></block-definition><block-definition s="any of Pinky Promises %&apos;proms&apos;" type="reporter" category="control"><header></header><code></code><translations>es:alguna de Promesas de Meñique _&#xD;</translations><inputs><input type="%mult%l"></input></inputs><script><block s="doReport"><custom-block s="new Pinky Promise %cmdRing"><block s="reifyScript"><script><custom-block s="let %upvar be %s"><l>pending</l><block s="reportListAttribute"><l><option>length</option></l><block var="proms"/></block></custom-block><custom-block s="let %upvar be %s"><l>vals</l><block s="reportNumbers"><l>1</l><block var="pending"/></block></custom-block><custom-block s="let %upvar be %s"><l>i</l><l>1</l></custom-block><block s="doForEach"><l>prom</l><block var="proms"/><script><block s="doRun"><block s="reifyScript"><script><custom-block s="ignore Pinky Promise %l then %cmdRing , catch %cmdRing"><block var="prom"/><block s="reifyScript"><script><block s="doSetVar"><l>vals</l><l></l></block><block s="doSetVar"><l>pending</l><l>-1</l></block></script><list></list></block><block s="reifyScript"><script><block s="doReplaceInList"><block var="j"/><block var="vals"/><l></l></block><block s="doChangeVar"><l>pending</l><l>-1</l></block></script><list></list></block></custom-block></script><list><l>j</l></list></block><list><block var="i"/></list></block><block s="doChangeVar"><l>i</l><l>1</l></block></script></block><block s="doWaitUntil"><block s="reportVariadicLessThan"><list><block var="pending"/><l>1</l></list></block></block><block s="doRun"><block s="reportIfElse"><block s="reportVariadicEquals"><list><block var="pending"/><l>0</l></list></block><block var="reject"/><block var="fulfill"/></block><list><block var="vals"/></list></block></script><list><l>fulfill</l><l>reject</l></list></block></custom-block></block></script></block-definition><block-definition s="race Pinky Promises %&apos;proms&apos;" type="reporter" category="control"><header></header><code></code><translations>es:competir Promesas de Meñique _&#xD;</translations><inputs><input type="%mult%l"></input></inputs><script><block s="doReport"><custom-block s="new Pinky Promise %cmdRing"><block s="reifyScript"><script><custom-block s="let %upvar be %s"><l>settled</l><block s="reportBoolean"><l><bool>false</bool></l></block></custom-block><custom-block s="let %upvar be %s"><l>fulfilled</l><block s="reportBoolean"><l><bool>true</bool></l></block></custom-block><block s="doDeclareVariables"><list><l>val</l></list></block><block s="doForEach"><l>prom</l><block var="proms"/><script><custom-block s="ignore Pinky Promise %l then %cmdRing , catch %cmdRing"><block var="prom"/><block s="reifyScript"><script><block s="doIf"><block s="reportNot"><block var="settled"/></block><script><block s="doSetVar"><l>val</l><l></l></block><block s="doSetVar"><l>settled</l><block s="reportBoolean"><l><bool>true</bool></l></block></block></script><list></list></block></script><list></list></block><block s="reifyScript"><script><block s="doIf"><block s="reportNot"><block var="settled"/></block><script><block s="doSetVar"><l>fulfilled</l><block s="reportBoolean"><l><bool>false</bool></l></block></block><block s="doSetVar"><l>val</l><l></l></block><block s="doSetVar"><l>settled</l><block s="reportBoolean"><l><bool>true</bool></l></block></block></script><list></list></block></script><list></list></block></custom-block></script></block><block s="doWaitUntil"><block var="settled"/></block><block s="doRun"><block s="reportIfElse"><block var="fulfilled"/><block var="fulfill"/><block var="reject"/></block><list><block var="val"/></list></block></script><list><l>fulfill</l><l>reject</l></list></block></custom-block></block></script></block-definition><block-definition s="%&apos;prom&apos; JavaScript Promise $arrowRight Pinky Promise" type="reporter" category="control" space="true"><header></header><code></code><translations>es:_ Promesa de JavaScript $arrowRight Promesa de Meñique&#xD;</translations><inputs><input type="%obj"></input></inputs><script><block s="doReport"><custom-block s="new Pinky Promise %cmdRing"><block s="reifyScript"><script><custom-block s="let %upvar be %s"><l>accessors</l><block s="evaluate"><block s="reportJSFunction"><list><l>prom</l></list><l>var state = 0, value = null;&#xD;if(prom instanceof Promise) {&#xD;  prom.then(x =&gt; {&#xD;    value = x; state = 1;&#xD;  }, y =&gt; {&#xD;    value = y; state = -1;&#xD;  });&#xD;} else {&#xD;  value = prom; state = 1;&#xD;}&#xD;return new List([() =&gt; state, () =&gt; value]);</l></block><list><block var="prom"/></list></block></custom-block><block s="doWaitUntil"><block s="evaluate"><block s="reportListItem"><l>1</l><block var="accessors"/></block><list></list></block></block><block s="doRun"><block s="reportIfElse"><block s="reportVariadicEquals"><list><block s="evaluate"><block s="reportListItem"><l>1</l><block var="accessors"/></block><list></list></block><l>1</l></list></block><block var="fulfill"/><block var="reject"/></block><list><block s="evaluate"><block s="reportListItem"><l>2</l><block var="accessors"/></block><list></list></block></list></block></script><list><l>fulfill</l><l>reject</l></list></block></custom-block></block></script></block-definition></blocks><primitives></primitives><stage name="Stage" width="480" height="360" costume="0" color="255,255,255,1" tempo="60" threadsafe="false" penlog="false" volume="100" pan="0" lines="round" ternary="false" hyperops="true" codify="false" inheritance="true" sublistIDs="false" id="970"><pentrails>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAeAAAAFoCAYAAACPNyggAAAAAXNSR0IArs4c6QAADoVJREFUeF7t1cEJAAAIxDDdf2m3sJ+4wEEQuuMIECBAgACBd4F9XzRIgAABAgQIjAB7AgIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAf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AgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECByxcQFpoRMBzwAAAABJRU5ErkJggg==</pentrails><costumes><list struct="atomic" id="971"></list></costumes><sounds><list struct="atomic" id="972"></list></sounds><variables></variables><blocks></blocks><scripts><script x="20" y="10"><custom-block s="new Pinky Promise %cmdRing"><block s="reifyScript"><script><block s="doWait"><l>1</l></block><block s="doRun"><block var="#1"/><list><l>Quick Fulfill</l></list></block></script><list><l>#1</l><l>#2</l></list></block></custom-block></script><script x="20" y="88.99999999999983"><custom-block s="new Pinky Promise %cmdRing"><block s="reifyScript"><script><block s="doWait"><l>5</l></block><block s="doRun"><block var="#1"/><list><l>Slow Fulfill</l></list></block></script><list><l>#1</l><l>#2</l></list></block></custom-block></script><script x="20" y="167.9999999999999"><custom-block s="new Pinky Promise %cmdRing"><block s="reifyScript"><script><block s="doWait"><l>1</l></block><block s="doRun"><block var="#2"/><list><l>Quick Reject</l></list></block></script><list><l>#1</l><l>#2</l></list></block></custom-block></script><script x="20" y="246.99999999999983"><custom-block s="new Pinky Promise %cmdRing"><block s="reifyScript"><script><block s="doWait"><l>5</l></block><block s="doRun"><block var="#2"/><list><l>Slow Reject</l></list></block></script><list><l>#1</l><l>#2</l></list></block></custom-block></script><comment x="20" y="325.99999999999983" w="226" collapsed="false">^ You can use those Pinky Promises to test the all of, all settled, any of, and race blocks.</comment></scripts><sprites select="1"><sprite name="Sprite" idx="1" x="0" y="0" heading="90" scale="1" volume="100" pan="0" rotation="1" draggable="true" costume="0" color="80,80,80,1" pen="tip" id="1041"><costumes><list struct="atomic" id="1042"></list></costumes><sounds><list struct="atomic" id="1043"></list></sounds><blocks></blocks><variables><variable name="example"><context id="1046"><inputs></inputs><variables></variables><script><custom-block s="let %upvar be %s"><l>var</l><l>Click Sprite or this script to run this script.</l></custom-block><block s="bubble"><custom-block s="new Pinky Promise %cmdRing"><block s="reifyScript"><script><block s="gotoXY"><l>0</l><l>0</l></block><block s="setHeading"><l>90</l></block><block s="doRepeat"><l>8</l><script><block s="doWait"><l>1</l></block><block s="turn"><l>45</l></block></script></block><block s="doRun"><block var="fulfill"/><list><l>iSpun</l></list></block></script><list><l>fulfill</l><l>reject</l></list></block></custom-block></block></script><receiver><ref id="1041"></ref></receiver><origin><ref id="1041"></ref></origin><context id="1081"><inputs></inputs><variables></variables><receiver><ref id="1041"></ref></receiver><origin><ref id="1041"></ref></origin></context></context></variable></variables><scripts><script x="10" y="10"><block s="receiveGo"></block><block s="doSetVar"><l>example</l><block s="reifyScript"><script><custom-block s="let %upvar be %s"><l>var</l><l>Click Sprite or this script to run this script.</l></custom-block><block s="bubble"><custom-block s="new Pinky Promise %cmdRing"><block s="reifyScript"><script><block s="gotoXY"><l>0</l><l>0</l></block><block s="setHeading"><l>90</l></block><block s="doRepeat"><l>8</l><script><block s="doWait"><l>1</l></block><block s="turn"><l>45</l></block></script></block><block s="doRun"><block var="fulfill"/><list><l>iSpun</l></list></block></script><list><l>fulfill</l><l>reject</l></list></block></custom-block></block></script><list></list></block></block><block s="gotoXY"><l>100</l><l>-100</l></block><block s="doThink"><block var="example"/></block></script><script x="10" y="337.00000000000034"><block s="receiveInteraction"><l><option>clicked</option></l></block><block s="doRun"><block var="example"/><list></list></block></script></scripts></sprite><watcher scope="Sprite" var="example" style="normal" x="4.458333333333485" y="4.458333333333336" color="243,118,29" hidden="true"/></sprites></stage><variables></variables></scene></scenes></project><media name="Pinky Promises" app="Snap! 10.1-dev, https://snap.berkeley.edu" version="2"></media></snapdata>