The WakeLock Component will allows you to keep the device screen awake, i.e. prevent the screen from sleeping
A minimal Demo Link
Value | Used as a | Description |
---|---|---|
WakeLock | ✅ Component | Can be used as Component |
wakeLock | ✅ Service | Can be used as Service |
// Default import will return WakeLock Component
import WakeLock from 'fe-pilot/WakeLock';
<WakeLock /> // Used as a Component
import { WakeLock, wakeLock } from 'fe-pilot/WakeLock';
<WakeLock /> // Used as a Component
wakeLock(); // Used as a Service
import { WakeLock } from 'fe-pilot/WakeLock';
const successCb = (response) => {
console.log("success response:", response);
}
const failureCb = (response) => {
console.log("failure response:", response);
}
wakeLock({ successCb, failureCb });
Props | Type | Description | Response |
---|---|---|---|
successCb | Function | It will be called on success |
{ data: "Can be array/object/string/number", msgType: "SUCCESSFUL", msg: "A success msg", status: "SUCCESS" } |
loadingCb | Function | It will be called before success/failure. |
{ msgType: "LOADING", msg: "LOADING...", status: "LOADING" } |
failureCb | Function | It will be called on failure |
{ msgType: "ERROR", msg: "A failed msg", status: "FAILURE" } |
Props | Type | Description | Default Values |
showForever | Boolean | To hide/remove unsupported feature, make it false. | Default value is true. |