{"id":21076557,"url":"https://github.com/monojack/xsrx","last_synced_at":"2026-02-06T12:34:59.056Z","repository":{"id":42842150,"uuid":"261585705","full_name":"monojack/xsrx","owner":"monojack","description":"Pipeable operators for xstream, with rxjs compatibility layer","archived":false,"fork":false,"pushed_at":"2023-01-06T05:42:05.000Z","size":494,"stargazers_count":3,"open_issues_count":8,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-19T10:07:20.192Z","etag":null,"topics":["compat","observable","operators","pipe","rxjs","xstream"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/monojack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-05T21:20:51.000Z","updated_at":"2023-05-11T10:33:54.000Z","dependencies_parsed_at":"2023-02-05T11:02:13.860Z","dependency_job_id":null,"html_url":"https://github.com/monojack/xsrx","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/monojack/xsrx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monojack%2Fxsrx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monojack%2Fxsrx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monojack%2Fxsrx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monojack%2Fxsrx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/monojack","download_url":"https://codeload.github.com/monojack/xsrx/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monojack%2Fxsrx/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266561168,"owners_count":23948610,"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","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":["compat","observable","operators","pipe","rxjs","xstream"],"created_at":"2024-11-19T19:29:05.524Z","updated_at":"2026-02-06T12:34:54.030Z","avatar_url":"https://github.com/monojack.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## xsrx\n\nPipeable operators for `xstream`, with `rxjs` compatibility layer.\n\n\u003cbr/\u003e\n\n**Reason**: Being an avid `rxjs` user I want to be able to use `xstream's` hot streams without having to \"switch\" to a different syntax. As a bonus: if I ever want to refactor to `rxjs` I'd only have to replace the imports.\n\n_NOTE:_ Does **NOT** convert from `xstream` to `rxjs`, so even though you wouldn't have to go through all your codebase to change operator names and from dot[.]chaining to piping, you might still have to deal with the fact that you're switching from hot to cold observables.\n\n**TL;DR**\n\n```js\nxs.periodic(1000)\n  .mapTo(1)\n  .fold((acc, c) =\u003e acc + c, 1)\n  .map(id =\u003e\n    xs.from(\n      fetch(`https://swapi.dev/api/people/${id}`).then(res =\u003e res.json()),\n    ),\n  )\n  .flatten()\n  .map(data =\u003e data.name)\n\n// to\ninterval(1000).pipe(\n  mapTo(1),\n  scan((acc, c) =\u003e acc + c, 1),\n  switchMap(id =\u003e\n    from(fetch(`https://swapi.dev/api/people/${id}`).then(res =\u003e res.json())),\n  ),\n  pluck('name'),\n)\n\n// or using the pipeline operator\n// https://github.com/tc39/proposal-pipeline-operator\ninterval(1000)\n  |\u003e mapTo(1)\n  |\u003e scan((acc, c) =\u003e acc + c, 1)\n  |\u003e switchMap(id =\u003e\n    from(fetch(`https://swapi.dev/api/people/${id}`).then(res =\u003e res.json())),\n  )\n  |\u003e pluck('name')\n\n// and it's still an `xstream` Stream\n```\n\n_Imports are the same as in `rxjs`_\n\n```js\nimport { interval } from 'xs.rx'\nimport { mapTo, scan, switchMap, pluck } from 'xs.rx/operators'\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonojack%2Fxsrx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmonojack%2Fxsrx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonojack%2Fxsrx/lists"}