{"id":18369843,"url":"https://github.com/cawfree/react-use-events","last_synced_at":"2026-05-06T10:34:08.946Z","repository":{"id":57347087,"uuid":"221574319","full_name":"cawfree/react-use-events","owner":"cawfree","description":"Simple react hooks for event handling.","archived":false,"fork":false,"pushed_at":"2019-11-14T00:54:36.000Z","size":3,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-17T15:47:07.633Z","etag":null,"topics":["event","events","hook","react","react-native","use"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cawfree.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-13T23:59:48.000Z","updated_at":"2019-12-10T23:33:52.000Z","dependencies_parsed_at":"2022-09-18T10:51:09.397Z","dependency_job_id":null,"html_url":"https://github.com/cawfree/react-use-events","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/cawfree%2Freact-use-events","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cawfree%2Freact-use-events/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cawfree%2Freact-use-events/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cawfree%2Freact-use-events/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cawfree","download_url":"https://codeload.github.com/cawfree/react-use-events/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248281425,"owners_count":21077423,"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":["event","events","hook","react","react-native","use"],"created_at":"2024-11-05T23:32:31.929Z","updated_at":"2025-10-28T18:32:15.333Z","avatar_url":"https://github.com/cawfree.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-use-events\nSimple react hooks for event handling.\n\n## 🚀 Getting Started\n\nUsing [`npm`]():\n\n```sh\nnpm install --save react-use-events\n```\n\nUsing [`yarn`]():\n\n```sh\nyarn add react-use-events\n```\n\n## ✍️ Usage\n\n```javascript\nimport React, { useEffect } from 'react';\nimport { useEvent, emitEvent } from 'react-use-events';\n\nconst eventName = 'SOME_EVENT_NAME';\n\nexport default () =\u003e {\n  // When your component is unmounted, the listener will be cleared.\n  const [ data ] = useEvent(\n    eventName,\n    // Define some initial data.\n    'No data received.',\n  );\n  useEffect(\n    () =\u003e {\n      // You can call this anywhere in your app; all registered\n      // components will be updated.\n      emitEvent(\n        eventName,\n        'Received some data.',\n      );\n    },\n    [],\n  );\n  return (\n    \u003cdiv\u003e\n      {data}\n    \u003c/div\u003e\n  );\n};\n```\n\n## ✌️  License\n[MIT](https://opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcawfree%2Freact-use-events","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcawfree%2Freact-use-events","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcawfree%2Freact-use-events/lists"}