{"id":20302357,"url":"https://github.com/re-js/unsubscriber","last_synced_at":"2025-09-08T00:03:52.065Z","repository":{"id":45824458,"uuid":"514530149","full_name":"re-js/unsubscriber","owner":"re-js","description":"How to easy collect unsubscribe functions for several sources","archived":false,"fork":false,"pushed_at":"2023-11-30T23:27:01.000Z","size":106,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-15T12:42:30.649Z","etag":null,"topics":["detach","unsubscribe","unsubscriber"],"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/re-js.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":"2022-07-16T09:09:42.000Z","updated_at":"2022-08-15T13:08:37.000Z","dependencies_parsed_at":"2025-01-14T10:49:13.200Z","dependency_job_id":"a8093e56-5344-4b65-9ae0-bd0b628e7642","html_url":"https://github.com/re-js/unsubscriber","commit_stats":{"total_commits":16,"total_committers":1,"mean_commits":16.0,"dds":0.0,"last_synced_commit":"b65a6ca8bf72131eab6cf1264727889715322a6d"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/re-js%2Funsubscriber","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/re-js%2Funsubscriber/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/re-js%2Funsubscriber/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/re-js%2Funsubscriber/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/re-js","download_url":"https://codeload.github.com/re-js/unsubscriber/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241801194,"owners_count":20022383,"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":["detach","unsubscribe","unsubscriber"],"created_at":"2024-11-14T16:30:54.151Z","updated_at":"2025-03-04T06:41:59.188Z","avatar_url":"https://github.com/re-js.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# unsubscriber\n\n[![npm version](https://img.shields.io/npm/v/unsubscriber?style=flat-square)](https://www.npmjs.com/package/unsubscriber)\n[![bundle size](https://img.shields.io/bundlephobia/minzip/unsubscriber?style=flat-square)](https://bundlephobia.com/result?p=unsubscriber)\n[![code coverage](https://img.shields.io/coveralls/github/re-js/unsubscriber?style=flat-square)](https://coveralls.io/github/re-js/unsubscriber)\n[![typescript supported](https://img.shields.io/npm/types/typescript?style=flat-square)](index.d.ts)\n\nHow to easy collect unsubscribe functions from several sources.\n\n```javascript\nimport { unsubscriber, collect, attach, run, scope, un } from \"unsubscriber\";\n\nconst unsubs = unsubscriber();\n\n// Run code and collect unsubscribers\nconst app = collect(usubs, () =\u003e {\n  un(() =\u003e {\n    console.log('unsubscribe');\n  });\n\n  attach(scope(), () =\u003e {});\n  return new App();\n});\n\nconst detach = attach(usubs, () =\u003e {});\n\nrun(usubs);\n```\n\nContext dependent functions who available into the function body:\n\n```javascript\nconst app = collect(usubs, () =\u003e {\n\n  const detach = un(unsubscriber);\n\n});\n```\n\nEnjoy your code!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fre-js%2Funsubscriber","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fre-js%2Funsubscriber","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fre-js%2Funsubscriber/lists"}