Socket
Socket
Sign inDemoInstall

screen-wake-lock

Package Overview
Dependencies
4
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.0 to 0.1.1

lib/ScreenWakeLock.d.ts

4

lib/index.d.ts

@@ -1,2 +0,2 @@

export { default } from './WakeLock';
export { default as useWakeLock } from './useWakeLock';
export { default } from './ScreenWakeLock';
export { default as useScreenWakeLock } from './useScreenWakeLock';
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useWakeLock = exports.default = void 0;
var WakeLock_1 = require("./WakeLock");
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return WakeLock_1.default; } });
var useWakeLock_1 = require("./useWakeLock");
Object.defineProperty(exports, "useWakeLock", { enumerable: true, get: function () { return useWakeLock_1.default; } });
exports.useScreenWakeLock = exports.default = void 0;
var ScreenWakeLock_1 = require("./ScreenWakeLock");
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return ScreenWakeLock_1.default; } });
var useScreenWakeLock_1 = require("./useScreenWakeLock");
Object.defineProperty(exports, "useScreenWakeLock", { enumerable: true, get: function () { return useScreenWakeLock_1.default; } });
{
"name": "screen-wake-lock",
"version": "0.1.0",
"version": "0.1.1",
"description": "React library to prevent computer from entering sleep mode",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -19,3 +19,3 @@ # screen-wake-lock.js

### Prevent device from entering sleep app-wide using WakeLock component
### Prevent device from entering sleep app-wide using ScreenWakeLock component

@@ -25,3 +25,3 @@ ```typescript

import ReactDOM from 'react-dom';
import WakeLock from 'screen-wake-lock';
import ScreenWakeLock from 'screen-wake-lock';
import App from './App';

@@ -31,3 +31,3 @@

<React.StrictMode>
<WakeLock />
<ScreenWakeLock />
<App />

@@ -39,7 +39,7 @@ </React.StrictMode>,

### Prevent device from entering sleep mode when a specific component is rendered using WakeLock component
### Prevent device from entering sleep mode when a specific component is rendered using ScreenWakeLock component
```typescript
import React from 'react';
import WakeLock from 'screen-wake-lock';
import ScreenWakeLock from 'screen-wake-lock';

@@ -49,3 +49,3 @@ const SpecificComponent = () => {

<>
<WakeLock />
<ScreenWakeLock />
<div>Sleepless in Seattle</div>

@@ -59,10 +59,10 @@ </>

### Prevent device from entering sleep mode when a specific component is rendered using useWakeLock hook
### Prevent device from entering sleep mode when a specific component is rendered using useScreenWakeLock hook
```typescript
import React from 'react';
import { useWakeLock } from 'screen-wake-lock';
import { useScreenWakeLock } from 'screen-wake-lock';
const SpecificComponent = () => {
useWakeLock();
useScreenWakeLock();
return <div>Sleepless in Seattle</div>;

@@ -74,12 +74,12 @@ };

### Use useWakeLock in debug mode
### Use useScreenWakeLock in debug mode
`useWakeLock` takes an optional parameter `debug`. When passed `true` it will print the status of the wake lock to the console whenever it gets locked or released. for instance when navigating away from the browser tab where the app is running and back. This can be a convenient way to test that the hook is working.
`useScreenWakeLock` takes an optional parameter `debug`. When passed `true` it will print the status of the wake lock to the console whenever it gets locked or released. for instance when navigating away from the browser tab where the app is running and back. This can be a convenient way to test that the hook is working.
```typescript
import React from 'react';
import { useWakeLock } from 'screen-wake-lock';
import { useScreenWakeLock } from 'screen-wake-lock';
const SpecificComponent = () => {
useWakeLock(true);
useScreenWakeLock(true);
return <div>Sleepless in Seattle</div>;

@@ -86,0 +86,0 @@ };

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc