Re: [w3c/manifest] Feat(events): add BeforeInstallPromptEvent (#520)

marcoscaceres commented on this pull request.



> +        </section>
+        <section>
+          <h4>
+            <code>prompt()</code> method
+          </h4>
+          <p>
+            The <dfn>prompt</dfn> method, when called, runs the following
+            steps:
+          </p>
+          <ol>
+            <li>Let <var>p</var> be a newly created promise.
+            </li>
+            <li>Run the following steps <a>in parallel</a>:
+              <ol>
+                <li>If <a>[[\promptOutcome]]</a> is not <code>null</code>,
+                resolve <var>p</var> with <a>[[\userResponsePromise]]</a> and

Ok... still in shock... back to this... 

> Why is p a new promise at all? Why can't we just have prompt() return userResponsePromise?

It avoids exposing the internal promise. Then .prompt() can vend promises that all get resolved when the internal one does. 

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/manifest/pull/520

Received on Wednesday, 9 November 2016 08:36:00 UTC