Re: [w3c/gamepad] extensions: Add vibrationActuator and dual-rumble effect (PR #163)

@marcoscaceres commented on this pull request.



> +          <p>
+            The {{GamepadHapticActuator/playEffect()}} method steps are:
+          </p>
+          <ol>
+            <li>If |params:GamepadEffectParameters| does not describe a [=valid
+            effect=] of type |type:GamepadHapticEffectType|, return [=a promise
+            resolved with=] {{GamepadHapticsResult/"invalid-parameter"}}.
+            </li>
+            <li>Let |document| be the [=current settings object=]'s [=relevant
+            global object=]'s [=associated `Document`=].
+            </li>
+            <li>If |document| is `null` or |document| is not [=Document/fully
+            active=] or |document|'s [=visibility state=] is `"hidden"`, return
+            [=a promise resolved with=] {{GamepadHapticsResult/"preempted"}}.
+            </li>
+            <li>If [=this=].{{GamepadHapticActuator/[[playingEffectPromise]]}}

As above, why not just return a new rejected promise here?

Also, this is seems to be racy. This is called twice, `[[playingEffectPromise]]` could resolve before the second call. 

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/gamepad/pull/163#pullrequestreview-999186101
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/gamepad/pull/163/review/999186101@github.com>

Received on Wednesday, 8 June 2022 06:35:44 UTC