{"id":22004425,"url":"https://github.com/cif/redux-fusion","last_synced_at":"2025-05-05T17:30:07.652Z","repository":{"id":19260704,"uuid":"86630652","full_name":"cif/redux-fusion","owner":"cif","description":"React bindings for RxJS and Redux","archived":false,"fork":false,"pushed_at":"2022-12-06T20:11:24.000Z","size":278,"stargazers_count":29,"open_issues_count":8,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-07T06:12:23.466Z","etag":null,"topics":["react","recompose","redux","rxjs"],"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/cif.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":"2017-03-29T21:23:02.000Z","updated_at":"2020-05-07T20:32:54.000Z","dependencies_parsed_at":"2023-01-13T20:16:08.299Z","dependency_job_id":null,"html_url":"https://github.com/cif/redux-fusion","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cif%2Fredux-fusion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cif%2Fredux-fusion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cif%2Fredux-fusion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cif%2Fredux-fusion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cif","download_url":"https://codeload.github.com/cif/redux-fusion/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227239604,"owners_count":17752498,"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":["react","recompose","redux","rxjs"],"created_at":"2024-11-30T00:15:54.542Z","updated_at":"2024-11-30T00:15:55.172Z","avatar_url":"https://github.com/cif.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# redux-fusion\n[![Build Status](https://travis-ci.org/cif/redux-fusion.svg?branch=master)](https://travis-ci.org/cif/redux-fusion)\n\n### Update Two Years Later\nIt's come to my attention this POC no longer works with current versions of React and Redux. This project unfortunately remained only simply to support the [conceputal article written on Medium](https://medium.com/@benipsen/introducing-redux-fusion-an-alternative-approach-to-react-reduxs-connect-method-for-rxjs-44248895b47d) in April 2017. Fortunately, there are now other libraries using similar concepts, namely [RefractJS](https://refract.js.org/usage/observing-redux). Happy observing!\n\n### What is this?\nThis module is a higher order component that serves as an alternative to `react-redux` [connect](https://github.com/reactjs/react-redux/blob/master/docs/api.md#connectmapstatetoprops-mapdispatchtoprops-mergeprops-options).\nThere is no additional buy in, all of your redux modules and containers can remain as-is.\nYou could even wrap an existing connected component with `fuse()` if desired.\n\n### How it works\nRedux `createStore` is [observable](https://github.com/reactjs/redux/blob/master/src/createStore.js#L203-L208)\nso it is straight forward to access store from root `\u003cProvider\u003e` context, convert to a `state$`\nobservable and subscribe the wrapped component's props via `mapPropsStream()`.\nSee [recompose's Observable utilities](https://github.com/acdlite/recompose/blob/master/docs/API.md#observable-utilities)\nfor more details.\n\nThe end result is developer ability to use bi-directional reactive programming to combine state and UI streams:\n\n### Usage Example\n\n```js\nimport React from 'react'\nimport { createEventHandler } from 'recompose'\nimport fuse from 'redux-fusion'\nimport { someReduxAction } from '../redux/actions'\n\nconst hello$ = (state$, dispatch) =\u003e (props$) =\u003e {\n  const {\n     handler: handleClick,\n     stream: click$\n  } = createEventHandler()\n\n  click$\n    .debounceTime(300)\n    .subscribe(() =\u003e dispatch(someReduxAction()))\n\n  const hello$ = state$\n    .pluck('hello')\n    .map(val =\u003e `Hello ${val}`)\n\n  return props$.combineLatest(hello$, (props, hello) =\u003e ({\n    hello,\n    handleClick\n  }))   \n}\n\nconst Hello = ({ handleClick, hello }) =\u003e\n  (\n    \u003cdiv\u003e\n      \u003ch3\u003e{hello}\u003c/h3\u003e\n      \u003cbutton onClick={handleClick}\u003eClick Me\u003c/button\u003e\n    \u003c/div\u003e\n  )\n\nconst HelloWorld = fuse(hello$)(Hello)\n\n```\n\n## Stay tuned for more real life examples!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcif%2Fredux-fusion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcif%2Fredux-fusion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcif%2Fredux-fusion/lists"}