Re: [w3c/screen-orientation] Editorial: Example 3 (#135)

marcoscaceres commented on this pull request.



>  
-        var orientationChangeHandler = function() {
-          if (!screen.orientation.type.startsWith('landscape')) {
-            return;
-          }
-          screen.orientation.removeEventListener('change', orientationChangeHandler);
-          startInternal();
-        }
+function orientationChangeListener() {
+  const inPortrait = window.matchMedia("(orientation: portrait)");
+  function detectOrientation(e) {
+    if (e.matches) {
+      return;
+    } else {

nit: ` else {`  is not needed here, because you are returning immediately. 

-- 
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/screen-orientation/pull/135#pullrequestreview-194514847

Received on Monday, 21 January 2019 10:00:20 UTC