This repository has been archived on 2022-03-12. You can view files and clone it, but cannot push or open issues or pull requests.
2021-04-02 02:24:13 +03:00

1 line
1.2 KiB
Plaintext

{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAE5C,MAAM,gBAAgB,GAAG,yBAAyB,CAAC;AAEnD,MAAM,UAAU,YAAY,CAAC,MAAc,gBAAgB;IACzD,SAAS,CAAC,GAAG,EAAE;QACb,iBAAiB,CAAC,GAAG,CAAC,CAAC;QACvB,OAAO,GAAG,EAAE,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC;IACxC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;AACZ,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,MAAc,gBAAgB;IAC9D,IAAI,aAAa,CAAC,QAAQ;QAAE,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AAC1D,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,MAAc,gBAAgB;IAChE,IAAI,aAAa,CAAC,UAAU;QAAE,aAAa,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;AAC9D,CAAC","sourcesContent":["import { useEffect } from 'react';\n\nimport ExpoKeepAwake from './ExpoKeepAwake';\n\nconst ExpoKeepAwakeTag = 'ExpoKeepAwakeDefaultTag';\n\nexport function useKeepAwake(tag: string = ExpoKeepAwakeTag): void {\n useEffect(() => {\n activateKeepAwake(tag);\n return () => deactivateKeepAwake(tag);\n }, [tag]);\n}\n\nexport function activateKeepAwake(tag: string = ExpoKeepAwakeTag): void {\n if (ExpoKeepAwake.activate) ExpoKeepAwake.activate(tag);\n}\n\nexport function deactivateKeepAwake(tag: string = ExpoKeepAwakeTag): void {\n if (ExpoKeepAwake.deactivate) ExpoKeepAwake.deactivate(tag);\n}\n"]}