Skip to content

Commit

Permalink
perf: reduce bundle size
Browse files Browse the repository at this point in the history
  • Loading branch information
jorisre committed Nov 24, 2020
1 parent 4d1ddb4 commit 9a0861e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,19 @@
"size-limit": [
{
"path": "dist/react-screen-wake-lock.js",
"limit": "389 B"
"limit": "384 B"
},
{
"path": "dist/react-screen-wake-lock.modern.js",
"limit": "311 B"
"limit": "304 B"
},
{
"path": "dist/react-screen-wake-lock.module.js",
"limit": "411 B"
"limit": "406 B"
},
{
"path": "dist/react-screen-wake-lock.umd.js",
"limit": "395 B"
"limit": "389 B"
}
],
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions src/use-wake-lock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const useWakeLock = ({
const wakeLock = React.useRef<WakeLockSentinel | null>(null);

// https://caniuse.com/mdn-api_wakelock
const isSupported = 'wakeLock' in window.navigator;
const isSupported = 'wakeLock' in navigator;

const request = React.useCallback(
async (type: WakeLockType = 'screen') => {
Expand All @@ -34,7 +34,7 @@ export const useWakeLock = ({
}

try {
wakeLock.current = await window.navigator.wakeLock.request(type);
wakeLock.current = await navigator.wakeLock.request(type);

wakeLock.current.onrelease = (e: Event) => {
// Default to `true` - `released` API is experimental: https://caniuse.com/mdn-api_wakelocksentinel_released
Expand Down

1 comment on commit 9a0861e

@vercel
Copy link

@vercel vercel bot commented on 9a0861e Nov 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.