{"id":16800128,"url":"https://github.com/bsideup/rx-connect","last_synced_at":"2025-03-17T03:31:08.736Z","repository":{"id":141754932,"uuid":"65577786","full_name":"bsideup/rx-connect","owner":"bsideup","description":"Glue your state and pure React components with RxJS","archived":false,"fork":false,"pushed_at":"2019-01-21T14:03:34.000Z","size":273,"stargazers_count":84,"open_issues_count":0,"forks_count":16,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-16T03:45:29.426Z","etag":null,"topics":["flux","react","reactive","redux","rx","rxjs"],"latest_commit_sha":null,"homepage":"https://bsideup.gitbooks.io/rxconnect/content/","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/bsideup.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2016-08-12T19:15:07.000Z","updated_at":"2025-03-15T20:58:27.000Z","dependencies_parsed_at":"2023-07-11T08:34:15.784Z","dependency_job_id":null,"html_url":"https://github.com/bsideup/rx-connect","commit_stats":{"total_commits":71,"total_committers":8,"mean_commits":8.875,"dds":0.2676056338028169,"last_synced_commit":"5c49689734dbb6bf22539a3f96ddcee8ebb263d9"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsideup%2Frx-connect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsideup%2Frx-connect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsideup%2Frx-connect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsideup%2Frx-connect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bsideup","download_url":"https://codeload.github.com/bsideup/rx-connect/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243841203,"owners_count":20356443,"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":["flux","react","reactive","redux","rx","rxjs"],"created_at":"2024-10-13T09:31:03.603Z","updated_at":"2025-03-17T03:31:08.401Z","avatar_url":"https://github.com/bsideup.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"RxConnect\n========\n[![Gitter](https://badges.gitter.im/bsideup/rx-connect.svg)](https://gitter.im/bsideup/rx-connect)\n[![NPM version](https://img.shields.io/npm/v/rx-connect.svg)](https://npmjs.com/package/rx-connect)\n[![Build Status](https://travis-ci.org/bsideup/rx-connect.svg?branch=master)](https://travis-ci.org/bsideup/rx-connect)\n[![license](https://img.shields.io/github/license/bsideup/rx-connect.svg?maxAge=2592000)]()\n\nRxConnect is like [Redux](https://github.com/reactjs/redux)'s `@connect`, but with all the power of [RxJS](https://github.com/Reactive-Extensions/RxJS).\n\n```\nnpm install --save rx-connect\n```\n\n\u003c!--remove--\u003e\n## Documentation\nYou can find the latest documentation here: http://bsideup.gitbooks.io/rxconnect/content/\n\u003c!--endremove--\u003e\n\n## Why?\nReplace this:\n\n```javascript\nclass Timer extends React.Component {\n\n    constructor(props) {\n        super(props);\n\n        this.state = {\n            counter: 0\n        }\n    }\n\n    componentWillMount() {\n        this.intervalRef = setInterval(\n            () =\u003e this.setState(state =\u003e ({ counter: state.counter + 1 })),\n            1000\n        )\n    }\n\n    componentWillUnmount() {\n        clearInterval(this.intervalRef)\n    }\n\n    render() {\n        return \u003cdiv\u003e{ this.state.counter }\u003c/div\u003e\n    }\n}\n```\n\nwith this:\n\n```javascript\nimport { rxConnect } from \"rx-connect\";\n\n@rxConnect(\n    Rx.Observable.timer(0, 1000).timestamp()\n)\nclass Timer extends React.PureComponent {\n    render() {\n        return \u003cdiv\u003e{ this.props.value }\u003c/div\u003e\n    }\n}\n```\n\n\u003e **NB:** We use decorators, but it's not required. These two code blocks are completely identical:\n\u003e\n\u003e ```javascript\n\u003e @rxConnect(...)\n\u003e export class MyView extends React.Component {\n\u003e     // ...\n\u003e }\n\u003e ```\n\u003e\n\u003e and\n\u003e\n\u003e  ```javascript\n\u003e class MyView extends React.Component {\n\u003e     // ...\n\u003e }\n\u003e export rxConnect(...)(MyView)\n\u003e ```\n\n## Using RxJS 4?\n\nThis library supports RxJS 5 by default, but provides an adapter for RxJS 4:\n\n```js\nimport { rxConnect } from \"rx-connect\";\nimport rx4Adapter from \"rx-connect/lib/rx4Adapter\";\nrxConnect.adapter = rx4Adapter;\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbsideup%2Frx-connect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbsideup%2Frx-connect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbsideup%2Frx-connect/lists"}