{"id":22311479,"url":"https://github.com/vilicvane/segmented","last_synced_at":"2025-03-26T02:15:17.641Z","repository":{"id":223280871,"uuid":"759805876","full_name":"vilicvane/segmented","owner":"vilicvane","description":null,"archived":false,"fork":false,"pushed_at":"2024-02-19T11:25:27.000Z","size":63,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T00:54:54.556Z","etag":null,"topics":[],"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/vilicvane.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}},"created_at":"2024-02-19T11:20:24.000Z","updated_at":"2024-02-19T11:20:32.000Z","dependencies_parsed_at":"2024-02-25T14:00:38.773Z","dependency_job_id":null,"html_url":"https://github.com/vilicvane/segmented","commit_stats":null,"previous_names":["vilicvane/segmented"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vilicvane%2Fsegmented","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vilicvane%2Fsegmented/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vilicvane%2Fsegmented/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vilicvane%2Fsegmented/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vilicvane","download_url":"https://codeload.github.com/vilicvane/segmented/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245573891,"owners_count":20637674,"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":[],"created_at":"2024-12-03T21:19:43.077Z","updated_at":"2025-03-26T02:15:17.613Z","avatar_url":"https://github.com/vilicvane.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![NPM version](https://img.shields.io/npm/v/segmented?color=%23cb3837\u0026style=flat-square)](https://www.npmjs.com/package/segmented)\n[![Repository package.json version](https://img.shields.io/github/package-json/v/vilicvane/segmented?color=%230969da\u0026label=repo\u0026style=flat-square)](./package.json)\n[![MIT License](https://img.shields.io/badge/license-MIT-999999?style=flat-square)](./LICENSE)\n[![Discord](https://img.shields.io/badge/chat-discord-5662f6?style=flat-square)](https://discord.gg/wEVn2qcf8h)\n\n# Segmented\n\nSegmented async operations to abort.\n\n## Installation\n\n```sh\nnpm install segmented\n```\n\n## Usage\n\n```ts\nimport {segment} from 'segmented';\n\nconst segmented = segment(() =\u003e fetch('https://example.com'))\n  .then(response =\u003e response.json())\n  .then(console.log);\n\nsegmented.abort();\n```\n\nThe `segmented` object returned is also an callable equivalent to `abort()` method:\n\n```ts\nimport {segment} from 'segmented';\n\nuseEffect(\n  () =\u003e\n    segment(() =\u003e fetch('https://example.com'))\n      .then(response =\u003e response.json())\n      .then(console.log),\n  [],\n);\n```\n\n## License\n\nMIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvilicvane%2Fsegmented","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvilicvane%2Fsegmented","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvilicvane%2Fsegmented/lists"}