{"id":19041920,"url":"https://github.com/writetome51/get-subscription-data","last_synced_at":"2026-06-18T12:32:06.209Z","repository":{"id":122062450,"uuid":"216448778","full_name":"writetome51/get-subscription-data","owner":"writetome51","description":"Async function that returns the data result of a Subscription (to a Subscribable) only once and then unsubscribes.","archived":false,"fork":false,"pushed_at":"2020-08-06T22:14:26.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-03T19:07:23.525Z","etag":null,"topics":["rxjs-observable","rxjs-subscriptions","unsubscribe"],"latest_commit_sha":null,"homepage":null,"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/writetome51.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-21T00:50:47.000Z","updated_at":"2020-08-06T22:14:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"d544d5ec-cde9-4812-b7db-ac99c6aea98a","html_url":"https://github.com/writetome51/get-subscription-data","commit_stats":{"total_commits":6,"total_committers":1,"mean_commits":6.0,"dds":0.0,"last_synced_commit":"6e623abd1230dd9195e1ed9a9a6dc278bd8e1e7e"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/writetome51/get-subscription-data","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writetome51%2Fget-subscription-data","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writetome51%2Fget-subscription-data/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writetome51%2Fget-subscription-data/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writetome51%2Fget-subscription-data/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/writetome51","download_url":"https://codeload.github.com/writetome51/get-subscription-data/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writetome51%2Fget-subscription-data/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34491226,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-18T02:00:06.871Z","response_time":128,"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":["rxjs-observable","rxjs-subscriptions","unsubscribe"],"created_at":"2024-11-08T22:33:21.981Z","updated_at":"2026-06-18T12:32:06.192Z","avatar_url":"https://github.com/writetome51.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# getSubscriptionData(\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;subscribable: Subscribable\u0026lt;any\u0026gt;\u003cbr\u003e): Promise\u0026lt;any\u0026gt;\n\nAsync function that only returns the first data result of a [Subscription](https://rxjs-dev.firebaseapp.com/api/index/class/Subscription) \n(to a [Subscribable](https://rxjs-dev.firebaseapp.com/api/index/interface/Subscribable))  \nand then unsubscribes automatically.  Useful if you only want the first result and don't  \nneed to keep the Subscription open.\n\n## Examples\n```js\nasync function logToConsole() {\n    let data = await getSubscriptionData(\n        sendHTTPRequest('http://website.com') // returns an observable\n    );\n    console.log(data);\n}\n\nasync function getFirstLottoNumber() {\n    return await getSubscriptionData(lottoNumbersObservable);\n}\n```\n\n## Installation\n`npm i  @writetome51/get-subscription-data`\n\n## Loading\n```js\nimport {getSubscriptionData} from '@writetome51/get-subscription-data';\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwritetome51%2Fget-subscription-data","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwritetome51%2Fget-subscription-data","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwritetome51%2Fget-subscription-data/lists"}