{"_id":"@adembacaj/react-native-hooks","_rev":"1-434fc731ddb9d47e0edc1cdcf43f2df3","name":"@adembacaj/react-native-hooks","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@adembacaj/react-native-hooks","version":"1.0.0","description":"Custom hooks that can help during development","main":"lib/commonjs/index","module":"lib/module/index","types":"lib/typescript/src/index.d.ts","react-native":"src/index","source":"src/index","private":false,"scripts":{"example":"yarn workspace @adembacaj/react-native-hooks-example","test":"jest","typecheck":"tsc --noEmit","lint":"eslint \"**/*.{js,ts,tsx}\"","clean":"del-cli lib","prepare":"bob build","release":"release-it"},"keywords":["react-native","ios","android"],"repository":{"type":"git","url":"git+https://github.com/adembacajdev/react-native-hooks.git"},"author":{"name":"Adem Bacaj","email":"adembacajdev@gmail.com","url":"https://github.com/adembacajdev"},"license":"MIT","bugs":{"url":"https://github.com/adembacajdev/react-native-hooks/issues"},"homepage":"https://github.com/adembacajdev/react-native-hooks#readme","publishConfig":{"registry":"https://registry.npmjs.org/"},"devDependencies":{"@commitlint/config-conventional":"^17.0.2","@evilmartians/lefthook":"^1.5.0","@react-native/eslint-config":"^0.72.2","@release-it/conventional-changelog":"^5.0.0","@types/jest":"^28.1.2","@types/react":"~17.0.21","@types/react-native":"0.70.0","commitlint":"^17.0.2","del-cli":"^5.0.0","eslint":"^8.4.1","eslint-config-prettier":"^8.5.0","eslint-plugin-prettier":"^4.0.0","jest":"^28.1.1","prettier":"^2.0.5","react":"18.2.0","react-native":"0.72.6","react-native-builder-bob":"^0.20.0","release-it":"^15.0.0","typescript":"^5.0.2"},"resolutions":{"@types/react":"17.0.21"},"peerDependencies":{"react":"*","react-native":"*"},"workspaces":["example"],"packageManager":"yarn@3.6.1","engines":{"node":">= 18.0.0"},"jest":{"preset":"react-native","modulePathIgnorePatterns":["<rootDir>/example/node_modules","<rootDir>/lib/"]},"commitlint":{"extends":["@commitlint/config-conventional"]},"release-it":{"git":{"commitMessage":"chore: release ${version}","tagName":"v${version}"},"npm":{"publish":true},"github":{"release":true},"plugins":{"@release-it/conventional-changelog":{"preset":"angular"}}},"eslintConfig":{"root":true,"extends":["@react-native","prettier"],"rules":{"prettier/prettier":["error",{"quoteProps":"consistent","singleQuote":true,"tabWidth":2,"trailingComma":"es5","useTabs":false}]}},"eslintIgnore":["node_modules/","lib/"],"prettier":{"quoteProps":"consistent","singleQuote":true,"tabWidth":2,"trailingComma":"es5","useTabs":false},"react-native-builder-bob":{"source":"src","output":"lib","targets":["commonjs","module",["typescript",{"project":"tsconfig.build.json"}]]},"gitHead":"e383ed4341bf05d1202d308fbfc9e0cde98b3aec","_id":"@adembacaj/react-native-hooks@1.0.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-M7LMnAH4byit56BdFR+HNo0wHgFMWQ9RTPcBoC6VWdx1sgvIg2XQGX3iXjMDcJ9mO0nAFf3WgU1cY+I793XrnQ==","shasum":"ff02427ef721bd61f954027a44289aa4a0da7b7d","tarball":"https://registry.npmjs.org/@adembacaj/react-native-hooks/-/react-native-hooks-1.0.0.tgz","fileCount":115,"unpackedSize":92861,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAXSeDL28lrx6XSFfYwB0Z8pmyL1c+hvMdMlUFTIU+dDAiEAk/7N0anDD0Rsm8m+KyTGTu2UTBQ1abKJB0fTuqFAxas="}]},"_npmUser":{"name":"adembacaj","email":"adembacajdev@gmail.com"},"directories":{},"maintainers":[{"name":"adembacaj","email":"adembacajdev@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-hooks_1.0.0_1700494244846_0.7731407349361252"},"_hasShrinkwrap":false},"1.0.1":{"name":"@adembacaj/react-native-hooks","version":"1.0.1","description":"Custom hooks that can help during development","main":"lib/commonjs/index","module":"lib/module/index","types":"lib/typescript/src/index.d.ts","react-native":"src/index","source":"src/index","private":false,"scripts":{"example":"yarn workspace @adembacaj/react-native-hooks-example","test":"jest","typecheck":"tsc --noEmit","lint":"eslint \"**/*.{js,ts,tsx}\"","clean":"del-cli lib","prepare":"bob build","release":"release-it"},"keywords":["react-native","ios","android"],"repository":{"type":"git","url":"git+https://github.com/adembacajdev/react-native-hooks.git"},"author":{"name":"Adem Bacaj","email":"adembacajdev@gmail.com","url":"https://github.com/adembacajdev"},"license":"MIT","bugs":{"url":"https://github.com/adembacajdev/react-native-hooks/issues"},"homepage":"https://github.com/adembacajdev/react-native-hooks#readme","publishConfig":{"registry":"https://registry.npmjs.org/"},"devDependencies":{"@commitlint/config-conventional":"^17.0.2","@evilmartians/lefthook":"^1.5.0","@react-native/eslint-config":"^0.72.2","@release-it/conventional-changelog":"^5.0.0","@types/jest":"^28.1.2","@types/react":"~17.0.21","@types/react-native":"0.70.0","commitlint":"^17.0.2","del-cli":"^5.0.0","eslint":"^8.4.1","eslint-config-prettier":"^8.5.0","eslint-plugin-prettier":"^4.0.0","jest":"^28.1.1","prettier":"^2.0.5","react":"18.2.0","react-native":"0.72.6","react-native-builder-bob":"^0.20.0","release-it":"^15.0.0","typescript":"^5.0.2"},"resolutions":{"@types/react":"17.0.21"},"peerDependencies":{"react":"*","react-native":"*"},"workspaces":["example"],"packageManager":"yarn@3.6.1","engines":{"node":">= 18.0.0"},"jest":{"preset":"react-native","modulePathIgnorePatterns":["<rootDir>/example/node_modules","<rootDir>/lib/"]},"commitlint":{"extends":["@commitlint/config-conventional"]},"release-it":{"git":{"commitMessage":"chore: release ${version}","tagName":"v${version}"},"npm":{"publish":true},"github":{"release":true},"plugins":{"@release-it/conventional-changelog":{"preset":"angular"}}},"eslintConfig":{"root":true,"extends":["@react-native","prettier"],"rules":{"prettier/prettier":["error",{"quoteProps":"consistent","singleQuote":true,"tabWidth":2,"trailingComma":"es5","useTabs":false}]}},"eslintIgnore":["node_modules/","lib/"],"prettier":{"quoteProps":"consistent","singleQuote":true,"tabWidth":2,"trailingComma":"es5","useTabs":false},"react-native-builder-bob":{"source":"src","output":"lib","targets":["commonjs","module",["typescript",{"project":"tsconfig.build.json"}]]},"gitHead":"ff3962cbced21bff3f641721f78125131ccb4a96","_id":"@adembacaj/react-native-hooks@1.0.1","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-A86cmMBNtX6yQsVsC96pUASlgy4WrYkXoHDl5Ovfwh0QodXqpBwROKAVBmnV8TyXNPb0FJeMMO8v5HKbA4W7Hg==","shasum":"86bbac37f2f3ceb7111544a96e48e410c624d8f8","tarball":"https://registry.npmjs.org/@adembacaj/react-native-hooks/-/react-native-hooks-1.0.1.tgz","fileCount":108,"unpackedSize":87208,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCqvcHiYOpXRNnvPcrJBQRxu1Fh4sGF8/CPBh5l/BT5MgIgJPtqQemmA1L6D/6qBjRcwKnkC08qJ0CT+2fBbmuiGCg="}]},"_npmUser":{"name":"adembacaj","email":"adembacajdev@gmail.com"},"directories":{},"maintainers":[{"name":"adembacaj","email":"adembacajdev@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-hooks_1.0.1_1700494571546_0.18635966843855623"},"_hasShrinkwrap":false}},"time":{"created":"2023-11-20T15:30:44.766Z","1.0.0":"2023-11-20T15:30:44.994Z","modified":"2023-11-20T15:36:11.876Z","1.0.1":"2023-11-20T15:36:11.731Z"},"maintainers":[{"name":"adembacaj","email":"adembacajdev@gmail.com"}],"description":"Custom hooks that can help during development","homepage":"https://github.com/adembacajdev/react-native-hooks#readme","keywords":["react-native","ios","android"],"repository":{"type":"git","url":"git+https://github.com/adembacajdev/react-native-hooks.git"},"author":{"name":"Adem Bacaj","email":"adembacajdev@gmail.com","url":"https://github.com/adembacajdev"},"bugs":{"url":"https://github.com/adembacajdev/react-native-hooks/issues"},"license":"MIT","readme":"# @adembacaj/react-native-hooks\n\nCustom hooks that can help during development\n\n## Installation\n\n```sh\nnpm install @adembacaj/react-native-hooks\nor if you are using Expo\nnpx expo install @adembacaj/react-native-hooks\n```\n\n## Usage\n\n### useAppActive\n\n```js\nimport { useAppActive } from '@adembacaj/react-native-hooks';\n\nconst isAppActive = useAppActive();\n```\n\n### useDimensions\n\n```js\nimport { useDimensions } from '@adembacaj/react-native-hooks';\n\nconst { windowWidth, windowHeight, screenWidth, screenHeight } =\n  useDimensions();\n```\n\n### useIsMounted\n\n```js\nimport { useIsMounted } from '@adembacaj/react-native-hooks';\n\nconst isMounted = useIsMounted();\n```\n\n### useKeyboard\n\n```js\nimport { useKeyboard } from '@adembacaj/react-native-hooks';\n\nconst { isKeyboardOpen } = useKeyboard();\n```\n\n### useOrientation\n\n```js\nimport { useOrientation } from '@adembacaj/react-native-hooks';\n\nconst orientation = useOrientation();\nif (orientation === 'PORTRAIT') {\n  //do something\n} else if (orientation === 'LANDSCAPE') {\n  //do something\n}\n```\n\n### useForceUpdate\n\n```js\nimport { useForceUpdate } from '@adembacaj/react-native-hooks';\n\nconst { showForceUpdate, setOptions } = useForceUpdate();\n\nconst checkForceUpdate = () => {\n  setOptions({\n    minRequiredVersion: '1.9.0',\n    currentVersion: '1.7.6', // you can use react-native-device-info to get app version installed\n  });\n};\n\nuseEffect(() => {\n  if (showForceUpdate) {\n    Alert.alert('Update!', 'There is a new update');\n  }\n}, [showForceUpdate]);\n```\n\n### useTimeout\n\n```js\nimport { useTimeout } from '@adembacaj/react-native-hooks';\n\nconst { clear, reset } = useTimeout(() => setCount(0), 1000);\n```\n\n### useDebounce\n\n```js\nimport { useDebounce } from '@adembacaj/react-native-hooks';\nuseDebounce(() => alert(count), 1000, [count]);\n```\n\n### useArray\n\n```js\nimport { useArray } from '@adembacaj/react-native-hooks';\nconst { array, set, push, remove, filter, update, clear } = useArray([\n  1, 2, 3, 4, 5, 6,\n]);\n```\n\n### useAsyncEffect\n\n```js\nimport { useAsyncEffect } from '@adembacaj/react-native-hooks';\nuseAsyncEffect(async () => {\n  const data = await fetchData();\n  // Do something with the data\n  return () => {\n    // Cleanup (if needed)\n  };\n}, [someDependency]);\n```\n\n### useModal\n\n```js\nimport { useModal } from '@adembacaj/react-native-hooks';\n\nconst { isVisible, showModal, hideModal } = useModal();\n```\n\n## Contributing\n\nSee the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.\n\n## License\n\nMIT\n\n---\n\nMade with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)\n","readmeFilename":"README.md"}