-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add more examples and use Permission API #44
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice! Added some comments.
index.bs
Outdated
|
||
als.onreading = () => { | ||
let str = luxToWorkplaceLevel(als.illuminance); | ||
if (typeof str !== 'undefined') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps:
if (str) {
console.log(\`Light level is suitable for: ${str}.\`);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
return 'mechanical workshops, drawing, supermarkets'; | ||
} else if (lux > 1000 && lux < 5000) { | ||
return 'detailed drawing work, visual tasks of low contrast'; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps good to explicitly return here (with and without will return undefined
):
return;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
f5f515c
to
b7adc08
Compare
Fixes: #43
Preview | Diff