{"id":20301059,"url":"https://github.com/chadly/react-socket-hooks","last_synced_at":"2026-02-23T16:34:12.071Z","repository":{"id":40815879,"uuid":"179714038","full_name":"chadly/react-socket-hooks","owner":"chadly","description":"A set of react hooks to work real nice with the WebSocket API","archived":false,"fork":false,"pushed_at":"2023-01-03T19:14:59.000Z","size":1197,"stargazers_count":4,"open_issues_count":15,"forks_count":0,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-08-21T08:39:26.808Z","etag":null,"topics":["hooks","react","websocket"],"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/chadly.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":"CODEOWNERS","security":null,"support":null}},"created_at":"2019-04-05T16:05:53.000Z","updated_at":"2021-08-15T13:44:24.000Z","dependencies_parsed_at":"2023-02-01T09:01:56.961Z","dependency_job_id":null,"html_url":"https://github.com/chadly/react-socket-hooks","commit_stats":null,"previous_names":["civicsource/react-socket-hooks","mdarens/react-socket-hooks"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chadly/react-socket-hooks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chadly%2Freact-socket-hooks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chadly%2Freact-socket-hooks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chadly%2Freact-socket-hooks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chadly%2Freact-socket-hooks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chadly","download_url":"https://codeload.github.com/chadly/react-socket-hooks/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chadly%2Freact-socket-hooks/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29748222,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-23T07:44:07.782Z","status":"ssl_error","status_checked_at":"2026-02-23T07:44:07.432Z","response_time":90,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["hooks","react","websocket"],"created_at":"2024-11-14T16:23:37.853Z","updated_at":"2026-02-23T16:34:12.053Z","avatar_url":"https://github.com/chadly.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React Socket Hooks\n\n\u003e A set of react hooks to work real nice with the WebSocket API.\n\n```js\nimport { useCallback } from \"react\";\nimport useSocket from \"react-socket-hooks\";\n\nconst mySocketMessageHandler1 = useCallback(msg =\u003e console.log(msg), []);\nconst mySocketMessageHandler2 = useCallback(msg =\u003e console.log(\"ohmy\", msg), []);\n\nconst { useMessageHandler, send } = useSocket(\"wss://example.com\");\nuseMessageHandler(mySocketMessageHandler1);\nuseMessageHandler(mySocketMessageHandler2);\n\n// …later, perhaps in response to a user action\nsend(\"hello, server\");\n```\n\nInstall with [Yarn](https://yarnpkg.com/en/):\n\n```shell\nyarn add react-socket-hooks\n```\n\nor if Yarn isn't your thing:\n\n```shell\nnpm install react-socket-hooks --save\n```\n\nThis library makes use of and assumes the [`WebSocket` API](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) is available on the global scope. You will need to polyfill it if it is not available in the current environment.\n\n## Build/Run Locally\n\nAfter cloning this repo, run:\n\n```shell\nyarn\nyarn lint\nyarn test\nyarn compile\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchadly%2Freact-socket-hooks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchadly%2Freact-socket-hooks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchadly%2Freact-socket-hooks/lists"}