{"id":19346582,"url":"https://github.com/canjs/can-rx","last_synced_at":"2025-04-23T05:30:47.884Z","repository":{"id":20326226,"uuid":"23600542","full_name":"canjs/can-rx","owner":"canjs","description":"RxJS integration for CanJS","archived":false,"fork":false,"pushed_at":"2017-08-15T23:32:58.000Z","size":32,"stargazers_count":2,"open_issues_count":1,"forks_count":3,"subscribers_count":14,"default_branch":"master","last_synced_at":"2024-04-14T23:20:15.312Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/canjs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-03T00:27:36.000Z","updated_at":"2016-11-08T19:23:58.000Z","dependencies_parsed_at":"2022-08-05T07:31:04.516Z","dependency_job_id":null,"html_url":"https://github.com/canjs/can-rx","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/canjs%2Fcan-rx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/canjs%2Fcan-rx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/canjs%2Fcan-rx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/canjs%2Fcan-rx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/canjs","download_url":"https://codeload.github.com/canjs/can-rx/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223909968,"owners_count":17223592,"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-11-10T04:10:55.693Z","updated_at":"2024-11-10T04:10:56.706Z","avatar_url":"https://github.com/canjs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# can.rx\n\n`can.rx` is a [CanJS](https://github.com/bitovi/canjs) plugin that lets you\ncreate [RxJS](https://github.com/Reactive-Extensions/RxJS) `Observable`s from\n`CanJS` event handlers, as well as feed `Observable` streams back into `CanJS`\nobservables. The result is a delicious, canned-bacon-flavored mix of\n[FRP](https://en.wikipedia.org/wiki/Functional_reactive_programming) and\n`CanJS`-style declarative MVC.\n\n`can.rx` implements the\n[can.eventstream](https://github.com/zkat/can.eventstream) interface and\nadds a few methods to `RxJS` objects (documented below). For information on the\n`CanJS` side of the interface, please refer to `can.eventstream`'s\ndocumentation.\n\nCheck out `dist/sandbox.html` and `dist/sandbox.js` for some rough usage\nexamples, including a fairly short drag-and-drop demo using `can.Component`, and\nsuper-simple, single-line two-way binding between pairs of computes and pairs of\n`can.Map`s.\n\n`can.rx` is\n[hosted at Github](http://github.com/zkat/can.rx). `can.rx` is a\npublic domain work, dedicated using\n[CC0 1.0](https://creativecommons.org/publicdomain/zero/1.0/). Feel free to do\nwhatever you want with it.\n\n# Quickstart\n\n### Install\n\n`$ npm install can.rx`\nor\n`$ bower install can.rx`\n\nPrebuilt releases are included in `dist`.\n\n### Example\n\n```javascript\nvar compute = can.compute(),\n    observable = compute.bind();\n\nobservable.subscribe(function(x) { console.log(\"Value changed: \", x); });\n\ncompute(1);\n\nobservable.toCompute().bind(\"change\", function() {\n  console.log(\"compute updated from property change.\");\n});\n\ncompute(2);\n\n```\n\n# Documentation\n\nFor the most part, `can.rx` is a straightforward implementation of the\n`can.eventstream` interface.\n\n`can.rx` also extends `Rx.Observable.prototype` with a few utility methods\nthat directly wrap `can.eventstream` functions, documented below.\n\n### `Rx.Observable#toCompute([compute=can.compute()])`\n\nWraps `can.bindComputeFromStream`.\n\n`stream.toCompute(compute)` is the same as `can.bindComputeFromStream(stream,\ncompute);`\n\n### `Rx.Observable#toMap([map=new can.Map()])`\n\nWraps `can.bindMapFromStream`.\n\n`stream.toMap(compute)` is the same as `can.bindMapFromStream(stream,\ncompute);`\n\n### `Rx.Observable#toList([list=new can.List()])`\n\nWraps `can.bindListFromStream`.\n\n`stream.toList(compute)` is the same as `can.bindListFromStream(stream,\ncompute);`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcanjs%2Fcan-rx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcanjs%2Fcan-rx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcanjs%2Fcan-rx/lists"}