{"id":46638201,"url":"https://github.com/tetherto/pear-apps-lib-ui-react-hooks","last_synced_at":"2026-03-08T02:13:05.656Z","repository":{"id":336815520,"uuid":"1113287808","full_name":"tetherto/pear-apps-lib-ui-react-hooks","owner":"tetherto","description":"PearPass is an open-source, privacy-first password manager with peer-to-peer syncing and end-to-end encryption. This repository contains shared core components used across the PearPass apps.","archived":false,"fork":false,"pushed_at":"2026-03-05T11:42:28.000Z","size":221,"stargazers_count":0,"open_issues_count":0,"forks_count":7,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-05T15:40:10.476Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://pass.pears.com/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tetherto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":"NOTICE","maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-09T19:13:59.000Z","updated_at":"2026-03-05T11:42:33.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/tetherto/pear-apps-lib-ui-react-hooks","commit_stats":null,"previous_names":["tetherto/pear-apps-lib-ui-react-hooks"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tetherto/pear-apps-lib-ui-react-hooks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetherto%2Fpear-apps-lib-ui-react-hooks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetherto%2Fpear-apps-lib-ui-react-hooks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetherto%2Fpear-apps-lib-ui-react-hooks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetherto%2Fpear-apps-lib-ui-react-hooks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tetherto","download_url":"https://codeload.github.com/tetherto/pear-apps-lib-ui-react-hooks/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetherto%2Fpear-apps-lib-ui-react-hooks/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30242406,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-08T00:58:18.660Z","status":"online","status_checked_at":"2026-03-08T02:00:06.215Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-03-08T02:13:05.131Z","updated_at":"2026-03-08T02:13:05.636Z","avatar_url":"https://github.com/tetherto.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pear-apps-lib-ui-react-hooks\n\nA collection of React hooks for Pearpass applications that simplify form handling, state management, and UI interactions.\n\n## Table of Contents\n\n- [Features](#features)\n- [Installation](#installation)\n- [Usage Examples](#usage-examples)\n- [Dependencies](#dependencies)\n- [Related Projects](#related-projects)\n\n## Features\n\n- **useForm**: Form state management with validation, array fields, and nested values\n- **useDebounce**: Delay state updates until after a specified delay\n- **useThrottle**: Limit the frequency of state updates\n- **useCountDown**: Create countdown timers with formatting\n\n## Installation\n\n```bash\nnpm install pear-apps-lib-ui-react-hooks\n```\n\n## Usage Examples\n\n### useForm\n\n```jsx\nimport { useForm } from 'pear-apps-lib-ui-react-hooks';\n\nconst MyForm = () =\u003e {\n    const validate = (values) =\u003e {\n        const errors = {};\n        if (!values.email) errors.email = 'Email is required';\n        return errors;\n    };\n\n    const { values, errors, register, handleSubmit } = useForm({\n        initialValues: { email: '', password: '' },\n        validate,\n    });\n\n    const onSubmit = (formValues) =\u003e {\n        console.log('Form submitted:', formValues);\n    };\n\n    return (\n        \u003cform onSubmit={handleSubmit(onSubmit)}\u003e\n            \u003cinput {...register('email')} /\u003e\n            {errors.email \u0026\u0026 \u003cspan\u003e{errors.email}\u003c/span\u003e}\n            \u003cbutton type=\"submit\"\u003eSubmit\u003c/button\u003e\n        \u003c/form\u003e\n    );\n};\n```\n\n### useDebounce\n\n```jsx\nimport { useDebounce } from 'pear-apps-lib-ui-react-hooks';\n\nconst SearchComponent = () =\u003e {\n    const [searchTerm, setSearchTerm] = useState('');\n    const { debouncedValue } = useDebounce({ value: searchTerm, delay: 500 });\n\n    useEffect(() =\u003e {\n        // This will only run 500ms after the last change to searchTerm\n        fetchSearchResults(debouncedValue);\n    }, [debouncedValue]);\n\n    return (\n        \u003cinput\n            value={searchTerm}\n            onChange={(e) =\u003e setSearchTerm(e.target.value)}\n            placeholder=\"Search...\"\n        /\u003e\n    );\n};\n```\n\n### useThrottle\n\n```jsx\nimport { useThrottle } from 'pear-apps-lib-ui-react-hooks';\n\nconst InfiniteScroll = () =\u003e {\n    const handleScroll = () =\u003e {\n        // Load more content on scroll\n    };\n\n    const { throttle } = useThrottle({ interval: 300 });\n\n    useEffect(() =\u003e {\n        const throttledHandler = () =\u003e throttle(handleScroll);\n        window.addEventListener('scroll', throttledHandler);\n        return () =\u003e window.removeEventListener('scroll', throttledHandler);\n    }, []);\n\n    return \u003cdiv\u003eScroll content...\u003c/div\u003e;\n};\n```\n\n### useCountDown\n\n```jsx\nimport { useCountDown } from 'pear-apps-lib-ui-react-hooks';\n\nconst Timer = () =\u003e {\n    const timeRemaining = useCountDown({\n        initialSeconds: 60,\n        onFinish: () =\u003e alert('Time is up!'),\n    });\n\n    return \u003cdiv\u003eTime remaining: {timeRemaining}\u003c/div\u003e;\n};\n```\n\n## Dependencies\n\n- React 18.3.1 or higher\n\n## Depended Submodules\n\nThe following sibling submodules must be present in the workspace (they are not declared as npm dependencies):\n\n- [`pear-apps-utils-generate-unique-id`](../pear-apps-utils-generate-unique-id)\n- [`tether-dev-docs`](../tether-dev-docs)\n\n## Related Projects\n\n- [pearpass-app-mobile](https://github.com/tetherto/pearpass-app-mobile) - A mobile app for PearPass, a password manager\n- [pearpass-app-desktop](https://github.com/tetherto/pearpass-app-desktop) - A desktop app for PearPass, a password\n- [tether-dev-docs](https://github.com/tetherto/tether-dev-docs) - Documentations and guides for developers\n\n## License\n\nThis project is licensed under the Apache License, Version 2.0. See the [LICENSE](./LICENSE) file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftetherto%2Fpear-apps-lib-ui-react-hooks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftetherto%2Fpear-apps-lib-ui-react-hooks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftetherto%2Fpear-apps-lib-ui-react-hooks/lists"}