- From: Marcos Cáceres <notifications@github.com>
- Date: Mon, 28 Aug 2017 04:10:32 +0000 (UTC)
- To: w3c/payment-request <payment-request@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <w3c/payment-request/pull/591/review/58849740@github.com>
marcoscaceres commented on this pull request. > + need to call <a>updateWith()</a> and provide a + <a>PaymentDetailsUpdate</a> dictionary, or a promise for one, + containing changed values that the <a>user agent</a> presents to + the user. + </p> + <p> + To prevent the user interface from blocking (and to reflect + changes made by the end-user through the UI), developers need to + immediately call <a>updateWith()</a>. If they don't, + <a>[[\didUpdate]]</a> becomes true and <a>updateWith()</a> + will throw. + </p> + <pre class="example" title="how to use `updateWith()` correctly."> + // ❌ Bad - this won't work! + request.onshippingaddresschange = async ev => { + // `await` goes to next tick, so [[didUpdate]] is now true. > Although that calls into question whether didUpdate is the right name, since nothing actually updated. Rethinking this: it actually did update... but instead of using the developer's `details`, the sheet used the details that were provided by the payment sheet itself. So maybe `updatedUI` might be better. @dlongley, I'd prefer not to flip it. I don't want to rewrite it :( -- 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/payment-request/pull/591#discussion_r135438654
Received on Monday, 28 August 2017 04:10:54 UTC