{"id":26682620,"url":"https://github.com/seonhyungjo/use-hammer","last_synced_at":"2025-04-12T13:51:34.254Z","repository":{"id":39246164,"uuid":"236442170","full_name":"SeonHyungJo/use-hammer","owner":"SeonHyungJo","description":"🔨 use-hammer : React Long Press Event","archived":false,"fork":false,"pushed_at":"2023-01-06T02:28:39.000Z","size":3572,"stargazers_count":2,"open_issues_count":38,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-26T08:34:20.319Z","etag":null,"topics":["hammer","hooks","longpress","react"],"latest_commit_sha":null,"homepage":"https://seonhyungjo.github.io/use-hammer/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SeonHyungJo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-27T07:52:28.000Z","updated_at":"2023-03-04T05:11:01.000Z","dependencies_parsed_at":"2023-02-05T03:01:56.308Z","dependency_job_id":null,"html_url":"https://github.com/SeonHyungJo/use-hammer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SeonHyungJo%2Fuse-hammer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SeonHyungJo%2Fuse-hammer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SeonHyungJo%2Fuse-hammer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SeonHyungJo%2Fuse-hammer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SeonHyungJo","download_url":"https://codeload.github.com/SeonHyungJo/use-hammer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248575719,"owners_count":21127254,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["hammer","hooks","longpress","react"],"created_at":"2025-03-26T08:27:40.817Z","updated_at":"2025-04-12T13:51:34.226Z","avatar_url":"https://github.com/SeonHyungJo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://seonhyungjo.github.io/use-hammer/\"\u003e\u003cimg width=\"140\" src=\"./static/use-hammer-logo.png\" alt=\"React useHammer Logo\" /\u003e\u003c/a\u003e\n\n\u003ch1 align=\"center\"\u003eReact useHammer Hooks\u003c/h1\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n[![NPM](https://img.shields.io/npm/v/use-hammer.svg)](https://www.npmjs.com/package/use-hammer) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n\n\u003c/div\u003e\n\n## Install\n\n```bash\nnpm install --save use-hammer\n```\n\n## Usage\n\n```tsx\nimport React from 'react'\nimport useHammer from 'use-hammer'\n\nconst Example = () =\u003e {\n  const onHammer = useCallback(() =\u003e {\n    console.log('Long Press')\n  }, [])\n\n  const [hammerDown, hammerUp] = useHammer({onHammer, second:300})\n  return (\n    \u003cdiv className={\"sample-div\"} onMouseDown={()=\u003e hammerDown()} onMouseUp={() =\u003e hammerUp()}/\u003e\n  )\n}\n```\n\n## API\n\n### `useHammer`\n\n| Prop | Type | Required | Description |\n| :--- | :--- | :------: | :---------- |\n| `onHammer` | Function |    ✓     | Execute onHammer Function |\n| `second` | number | | [Default:700ms] Millisecond |\n\n## License\n\nMIT © [snyung](https://github.com/snyung)\n\n---\n\nThis hook is created using [create-react-hook](https://github.com/hermanya/create-react-hook).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseonhyungjo%2Fuse-hammer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseonhyungjo%2Fuse-hammer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseonhyungjo%2Fuse-hammer/lists"}