{"id":21521607,"url":"https://github.com/zzarcon/react-observable-hook","last_synced_at":"2025-06-15T10:34:36.504Z","repository":{"id":57341989,"uuid":"156168805","full_name":"zzarcon/react-observable-hook","owner":"zzarcon","description":"Generic utility to get free updates from a RXJS observable using React hooks","archived":false,"fork":false,"pushed_at":"2018-12-17T15:21:32.000Z","size":144,"stargazers_count":7,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-12T22:42:00.683Z","etag":null,"topics":["hooks","observable","react","react-hooks","rxjs","subscription","updates","usestate"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/zzarcon.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":"2018-11-05T06:07:48.000Z","updated_at":"2023-10-11T05:17:10.000Z","dependencies_parsed_at":"2022-09-16T03:01:16.151Z","dependency_job_id":null,"html_url":"https://github.com/zzarcon/react-observable-hook","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zzarcon/react-observable-hook","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zzarcon%2Freact-observable-hook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zzarcon%2Freact-observable-hook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zzarcon%2Freact-observable-hook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zzarcon%2Freact-observable-hook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zzarcon","download_url":"https://codeload.github.com/zzarcon/react-observable-hook/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zzarcon%2Freact-observable-hook/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259547360,"owners_count":22874641,"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":["hooks","observable","react","react-hooks","rxjs","subscription","updates","usestate"],"created_at":"2024-11-24T01:07:44.497Z","updated_at":"2025-06-15T10:34:36.467Z","avatar_url":"https://github.com/zzarcon.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-observable-hook\n\u003e Syntax sugar for rxjs observables and React hooks\n\nGeneric utility to get free updates from a RXJS observable using React hooks.\n\n## Install\n\n```\n$ yarn add react-observable-hook\n```\n\n## Usage\n\n**full example**\n\n```typescript\nimport useObservable from 'react-observable-hook'\nimport {ReplaySubject} from 'rxjs';\n\nexport interface Clock {\n  seconds: number;\n}\n\nconst subject = new ReplaySubject\u003cClock\u003e(1);\nsetInterval(() =\u003e {\n  subject.next({seconds: new Date().getSeconds()});\n}, 1000);\n\nexport default () =\u003e {\n  const clock = useObservable\u003cClock\u003e(subject);\n\n  return (\n    \u003cdiv\u003e\n      \u003cdiv\u003e\n        Seconds: {clock ? clock.seconds : 'loading...'}\n      \u003c/div\u003e\n    \u003c/div\u003e\n  )\n}\n```\n\n**initial state**\n\n```typescript\nconst clock = useObservable\u003cClock\u003e(subject, () =\u003e {seconds: new Date().getSeconds()});\n```\n\n## ⚠️ Warning ⚠️\n\nYou need to provide:\n\n```json\n\"react\": \"^16.7.0-alpha.0\",\n\"react-dom\": \"16.7.0-alpha.0\"\n```\n\n## Author \n\n[@zzarcon](https://twitter.com/zzarcon) 😜","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzzarcon%2Freact-observable-hook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzzarcon%2Freact-observable-hook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzzarcon%2Freact-observable-hook/lists"}