{"_id":"redux-rx","_rev":"13-6dfe25ffac6e46bba8eef8eb728d3e0c","name":"redux-rx","description":"RxJS utilities for Redux","dist-tags":{"latest":"0.5.0","prerelease":"0.4.0-alpha"},"versions":{"0.1.0":{"name":"redux-rx","version":"0.1.0","description":"RxJS utilities for Redux","main":"lib/index.js","scripts":{"test":"make test","prepublish":"make clean build"},"keywords":["redux","observable","middleware","redux-middleware","rxjs","rx","reactive","fsa","flux"],"author":{"name":"Andrew Clark","email":"acdlite@me.com"},"license":"MIT","devDependencies":{"babel":"^5.6.14","babel-core":"^5.6.15","babel-eslint":"^3.1.20","chai":"^3.0.0","chai-as-promised":"^5.1.0","eslint":"^0.24.0","eslint-config-airbnb":"0.0.6","mocha":"^2.2.5","rx":"^2.5.3","sinon":"^1.15.4"},"dependencies":{"flux-standard-action":"^0.1.0"},"gitHead":"cb4903495fae8a8398eea38c6b40c5a77d8c07a9","_id":"redux-rx@0.1.0","_shasum":"06eb2f373b35fae6f9d1c08e49279b7a29a603c6","_from":".","_npmVersion":"2.12.0","_nodeVersion":"2.2.1","_npmUser":{"name":"acdlite","email":"acdlite@me.com"},"dist":{"shasum":"06eb2f373b35fae6f9d1c08e49279b7a29a603c6","tarball":"https://registry.npmjs.org/redux-rx/-/redux-rx-0.1.0.tgz","integrity":"sha512-QxVJZTSoWc9RwWDT2Er4gBnJUTAh4sEuw5qeWfGrpclwETJHC9HCr2WpQda2YSlKrmugbefr6DhBrJK4VMycJw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDTasBxBx5cKjz47C0qfvo4e/My5asRWipT4E6NV+vOOQIgbXKGjC+tKrDoz8IKhLICVx6HbS94sjX48DLDO/jO6Yk="}]},"maintainers":[{"name":"acdlite","email":"acdlite@me.com"}]},"0.2.0":{"name":"redux-rx","version":"0.2.0","description":"RxJS utilities for Redux","main":"lib/index.js","scripts":{"test":"make test","prepublish":"make clean build"},"keywords":["redux","observable","middleware","redux-middleware","rxjs","rx","reactive","fsa","flux"],"author":{"name":"Andrew Clark","email":"acdlite@me.com"},"license":"MIT","devDependencies":{"babel":"^5.6.14","babel-core":"^5.6.15","babel-eslint":"^3.1.20","chai":"^3.0.0","chai-as-promised":"^5.1.0","eslint":"^0.24.0","eslint-config-airbnb":"0.0.6","mocha":"^2.2.5","rx":"^2.5.3","sinon":"^1.15.4"},"dependencies":{"flux-standard-action":"^0.6.0"},"gitHead":"08e13b0e546eb1bcfba76f56913d75cf59c247cb","_id":"redux-rx@0.2.0","_shasum":"5aab575527ae497ae2646e455a5544a7b690133f","_from":".","_npmVersion":"2.12.0","_nodeVersion":"2.2.1","_npmUser":{"name":"acdlite","email":"acdlite@me.com"},"dist":{"shasum":"5aab575527ae497ae2646e455a5544a7b690133f","tarball":"https://registry.npmjs.org/redux-rx/-/redux-rx-0.2.0.tgz","integrity":"sha512-FGyVbnXxeDdo2mglMg77uet1LFmZb5qOxxQHu262mv9HYKQAY2ZwCuTxwcXukAbDvR4YvokPDpRAmu0S1FbFRQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAX+UojnmmSSX2qrmvzM8cSsl3VONItfX5NSukttQaivAiEAk72ZmCHC5TyEL57nrQ6YgtQT5jP5RcRSbI6TsR7X4eM="}]},"maintainers":[{"name":"acdlite","email":"acdlite@me.com"}]},"0.3.0":{"name":"redux-rx","version":"0.3.0","description":"RxJS utilities for Redux","main":"lib/index.js","scripts":{"test":"make test","prepublish":"make clean build"},"keywords":["redux","observable","middleware","redux-middleware","rxjs","rx","reactive","fsa","flux"],"author":{"name":"Andrew Clark","email":"acdlite@me.com"},"license":"MIT","devDependencies":{"babel":"^5.6.14","babel-core":"^5.6.15","babel-eslint":"^3.1.20","chai":"^3.0.0","chai-as-promised":"^5.1.0","eslint":"^0.24.0","eslint-config-airbnb":"0.0.6","eslint-plugin-react":"^2.6.4","jsdom":"^5.6.0","mocha":"^2.2.5","mocha-jsdom":"^1.0.0","react":"^0.13.3","redux":"^0.12.0","rx":"^2.5.3","sinon":"^1.15.4"},"dependencies":{"flux-standard-action":"^0.6.0","react-rx-component":"^0.3.0"},"gitHead":"3cbaff79242faabc456c0d4533de5cc6a5688e08","_id":"redux-rx@0.3.0","_shasum":"79c2b90e7abd24a6af39eda696049f79c7499d53","_from":".","_npmVersion":"2.12.0","_nodeVersion":"2.2.1","_npmUser":{"name":"acdlite","email":"acdlite@me.com"},"dist":{"shasum":"79c2b90e7abd24a6af39eda696049f79c7499d53","tarball":"https://registry.npmjs.org/redux-rx/-/redux-rx-0.3.0.tgz","integrity":"sha512-GEKjboUBq7g0Q8ScBpjhSQ+GOkLuCkkVp9LliHWzYwq30Xp1Y9Ro+AbLCWTxaO7bN5SSeuQ787JNbSoEwRM/ng==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAvDqjwPS248MwULwKvaiZ1at3G2D4DU1h2qAqc2d1qeAiEAm7FUXBV02fb9xmFAlVNaFn1mE17jo2ie3ZOqsQNUbws="}]},"maintainers":[{"name":"acdlite","email":"acdlite@me.com"}]},"0.4.0-alpha":{"name":"redux-rx","version":"0.4.0-alpha","description":"RxJS utilities for Redux","main":"lib/index.js","scripts":{"test":"make test","prepublish":"make clean build"},"keywords":["redux","observable","middleware","redux-middleware","rxjs","rx","reactive","fsa","flux"],"author":{"name":"Andrew Clark","email":"acdlite@me.com"},"license":"MIT","devDependencies":{"babel":"^5.6.14","babel-core":"^5.6.15","babel-eslint":"^3.1.20","chai":"^3.0.0","chai-as-promised":"^5.1.0","eslint":"^0.24.0","eslint-config-airbnb":"0.0.6","eslint-plugin-react":"^2.6.4","jsdom":"^5.6.0","mocha":"^2.2.5","mocha-jsdom":"^1.0.0","react":"^0.13.3","redux":"^1.0.0-rc","rx":"^2.5.3","sinon":"^1.15.4"},"dependencies":{"flux-standard-action":"^0.6.0","react-redux":"^0.2.2","react-rx-component":"^0.3.0"},"gitHead":"a98827123af8fd3972716e07caf0ee13f802b162","_id":"redux-rx@0.4.0-alpha","_shasum":"19e59c96e50a4ce570bc754d73360a86f5177251","_from":".","_npmVersion":"2.12.0","_nodeVersion":"2.2.1","_npmUser":{"name":"acdlite","email":"acdlite@me.com"},"dist":{"shasum":"19e59c96e50a4ce570bc754d73360a86f5177251","tarball":"https://registry.npmjs.org/redux-rx/-/redux-rx-0.4.0-alpha.tgz","integrity":"sha512-dRo4W73RS1qc1vWXQNZ7fLkw/4CLksadc8fDoxHyb32E1Hzmbz8TJ+GWMHxdwOxC5k0PKrNxlMtT3mFaL3HSaA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD+lbMgLYCI422W1y1Ybyz225mm5wPmayo4BIAAf0XDqAIgb817eMR9cjxIZEXw14DT4TFlVMfYerENvc4ln5BHzsE="}]},"maintainers":[{"name":"acdlite","email":"acdlite@me.com"}]},"0.4.0":{"name":"redux-rx","version":"0.4.0","description":"RxJS utilities for Redux","main":"lib/index.js","scripts":{"test":"make test","prepublish":"make clean build"},"keywords":["redux","observable","middleware","redux-middleware","rxjs","rx","reactive","fsa","flux"],"author":{"name":"Andrew Clark","email":"acdlite@me.com"},"homepage":"https://github.com/acdlite/redux-rx","license":"MIT","bugs":{"url":"https://github.com/acdlite/redux-rx/issues"},"devDependencies":{"babel":"^5.6.14","babel-core":"^5.6.15","babel-eslint":"^3.1.20","chai":"^3.0.0","chai-as-promised":"^5.1.0","eslint":"^0.24.0","eslint-config-airbnb":"0.0.6","eslint-plugin-react":"^2.6.4","jsdom":"^5.6.0","mocha":"^2.2.5","mocha-jsdom":"^1.0.0","react":"^0.13.3","redux":"^1.0.0-rc","rx":"^2.5.3","sinon":"^1.15.4"},"dependencies":{"flux-standard-action":"^0.6.0","react-redux":"^0.2.2","react-rx-component":"^0.5.0"},"gitHead":"dbefddc376dec76e3a9486120ba7279da6c5fa0c","_id":"redux-rx@0.4.0","_shasum":"ef39cd5fdfe9b4173cad6909c065a493ca854db3","_from":".","_npmVersion":"2.12.0","_nodeVersion":"2.2.1","_npmUser":{"name":"acdlite","email":"acdlite@me.com"},"dist":{"shasum":"ef39cd5fdfe9b4173cad6909c065a493ca854db3","tarball":"https://registry.npmjs.org/redux-rx/-/redux-rx-0.4.0.tgz","integrity":"sha512-CtBtAwBXbOj+nnE34NGhnUz3IH/cyO+ZoONb6pob1SgCnlkzcgzIOWRN9dRl+OGShsEpJqJF0ev7CLysAmf2ug==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH1gqf0gSs1FxmfwMLnCizElrXc/ToF9wHRcAVb07nwXAiEA8i6M9jO9f88qqZGImbyjwZu8XHZhjlwQBueHM9sz7Ss="}]},"maintainers":[{"name":"acdlite","email":"acdlite@me.com"}]},"0.5.0":{"name":"redux-rx","version":"0.5.0","description":"RxJS utilities for Redux","main":"lib/index.js","scripts":{"test":"make test","prepublish":"make clean build"},"keywords":["redux","observable","middleware","redux-middleware","rxjs","rx","reactive","fsa","flux"],"author":{"name":"Andrew Clark","email":"acdlite@me.com"},"homepage":"https://github.com/acdlite/redux-rx","license":"MIT","repository":{"type":"git","url":"git+https://github.com/acdlite/redux-rx.git"},"bugs":{"url":"https://github.com/acdlite/redux-rx/issues"},"devDependencies":{"babel":"^5.6.14","babel-core":"^5.6.15","babel-eslint":"^3.1.20","chai":"^3.0.0","chai-as-promised":"^5.1.0","eslint":"^0.24.0","eslint-config-airbnb":"0.0.6","eslint-plugin-react":"^2.6.4","fbjs":"0.3.2","jsdom":"^5.6.0","mocha":"^2.2.5","mocha-jsdom":"^1.0.0","react":"^0.14.0","react-addons-test-utils":"0.14.0","redux":"^3.0.3","rx":"^4.0.6","sinon":"^1.15.4"},"dependencies":{"flux-standard-action":"^0.6.0","react-redux":"^4.0.0","react-rx-component":"^0.5.0"},"gitHead":"4d6ead82fa8ea31c116d1a256d1bf92e3b79f3b7","_id":"redux-rx@0.5.0","_shasum":"a7959c2a16922b116c4ee7a869990608dc0bda85","_from":".","_npmVersion":"3.3.6","_nodeVersion":"5.0.0","_npmUser":{"name":"acdlite","email":"acdlite@me.com"},"dist":{"shasum":"a7959c2a16922b116c4ee7a869990608dc0bda85","tarball":"https://registry.npmjs.org/redux-rx/-/redux-rx-0.5.0.tgz","integrity":"sha512-9ZWB6nVQ5LQqArNdUCDcT7I/neuu0xLzrujavOyk4Cn/wy5+fWs71UzRdXZyknLyesdpOpyf33GFdouvI/SnHQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICa5FLspKyOkhIqG3p1GCGCp3mhl53GPrddOwqhE6hmTAiEAiSsh3yvJIDZK7Vjh9CBnu2u94TrPZSFW52/dNN9FECM="}]},"maintainers":[{"name":"acdlite","email":"acdlite@me.com"}]}},"readme":"redux-rx\n========\n\n[![build status](https://img.shields.io/travis/acdlite/redux-rx/master.svg?style=flat-square)](https://travis-ci.org/acdlite/redux-rx)\n[![npm version](https://img.shields.io/npm/v/redux-rx.svg?style=flat-square)](https://www.npmjs.com/package/redux-rx)\n\nRxJS utilities for Redux. Includes\n\n- A utility to create Connector-like smart components using RxJS sequences.\n  - A special version of `bindActionCreators()` that works with sequences.\n- An [FSA](https://github.com/acdlite/flux-standard-action)-compliant observable [middleware](https://github.com/gaearon/redux/blob/master/docs/middleware.md)\n- A utility to create a sequence of states from a Redux store.\n\n```js\nnpm install --save redux-rx rx\n```\n\n## Usage\n\n```js\nimport { createConnector } from 'redux-rx/react';\nimport { bindActionCreators, observableMiddleware, observableFromStore } from 'redux-rx';\n```\n\n## `createConnector(selectState, ?render)`\n\nThis lets you create Connector-like smart components using RxJS sequences. `selectState()` accepts three sequences as parameters\n\n- `props$` - A sequence of props passed from the owner\n- `state$` - A sequence of state from the Redux store\n- `dispatch$` - A sequence representing the `dispatch()` method. In real-world usage, this should sequence only has a single value, but it's provided as a sequence for correctness.\n\n`selectState()` should return a sequence of props that can be passed to the child. This provides a great integration point for [sideways data-loading](https://github.com/facebook/react/issues/3398).\n\nHere's a simple example using web sockets:\n\n```js\nconst TodoConnector = createConnector((props$, state$, dispatch$) => {\n  // Special version of bindActionCreators that works with sequences; see below\n  const actionCreators$ = bindActionCreators(actionCreators, dispatch$);\n  const selectedState$ = state$.map(s => s.messages);\n\n  // Connect to a websocket using rx-dom\n  const $ws = fromWebSocket('ws://chat.foobar.org').map(e => e.data)\n    .withLatestFrom(actionCreators$, (message, ac) =>\n      () => ac.receiveMessage(message)\n    )\n    .do(dispatchAction => dispatchAction()); // Dispatch action for new messages\n\n  return combineLatest(\n    props$, selectedState$, actionCreators$, $ws,\n    (props, selectedState, actionCreators) => ({\n      ...props,\n      ...selectedState,\n      ...actionCreators\n    }));\n});\n```\n\nPretty simple, right? Notice how there are no event handlers to clean up, no `componentWillReceiveProps()`, no `setState`. Everything is just a sequence.\n\nIf you're new to RxJS, this may look confusing at first, but — like React — if you give it a try you may be surprised by how simple and *fun* reactive programming can be.\n\n**TODO: React Router example. See [this comment](https://github.com/gaearon/redux/issues/227#issuecomment-119237073) for now.**\n\n`render()` is an optional second parameter which maps child props to a React element (vdom). This parameter can also be a React Component class — or, if you omit it entirely, a higher-order component is returned. See `createRxComponent()` of [react-rx-component](https://github.com/acdlite/react-rx-component) for more details. (This function is a wrapper around that library's `createRxComponent()`.)\n\nNot that unlike Redux's built-in Connector, the resulting component does not have a `select` prop. It is superseded by the `selectState` function described above. Internally, `shouldComponentUpdate()` is still used for performance.\n\n**NOTE** `createConnector()` is a wrapper around [react-rx-component](https://github.com/acdlite/react-rx-component). Check out that project for more information on how to use RxJS to construct smart components.\n\n### `bindActionCreators(actionCreators, dispatch$)`\n\nThis is the same, except `dispatch$` can be either a dispatch function *or* a sequence of dispatch functions. See previous section for context.\n\n### `observableMiddleware`\n\nThe middleware works on RxJS observables, and Flux Standard Actions whose payloads are observables.\n\nThe default export is a middleware function. If it receives a promise, it will dispatch the resolved value of the promise. It will not dispatch anything if the promise rejects.\n\nIf it receives an Flux Standard Action whose `payload` is an observable, it will\n\n- dispatch a new FSA for each value in the sequence.\n- dispatch an FSA on error.\n\nThe middleware does not subscribe to the passed observable. Rather, it returns the observable to the caller, which is responsible for creating a subscription. Dispatches occur as a side effect (implemented using `doOnNext()` and `doOnError()`).\n\n#### Example\n\n```js\n// fromEvent() used just for illustration. More likely, if you're using React,\n// you should use something rx-react's FuncSubject\n// https://github.com/fdecampredon/rx-react#funcsubject\nconst buttonClickStream = Observable.fromEvent(button, 'click');\n\n// Stream of new todos, with debouncing\nconst newTodoStream = buttonClickStream\n  .debounce(100)\n  .map(getTodoTextFromInput);\n\n// Dispatch new todos whenever they're created\ndispatch(newTodoStream).subscribe();\n```\n\n### `observableFromStore(store)`\n\nCreates an observable sequence of states from a Redux store.\n\nThis is a great way to react to state changes outside of the React render cycle. See [this discussion](https://github.com/gaearon/redux/issues/177#issuecomment-115389776) for an example. I'll update with a proper example once React Router 1.0 is released.\n\nAlso, I'm not a Cycle.js user, but I imagine this is useful for integrating Redux with that library.\n","maintainers":[{"email":"chi187@gmail.com","name":"chicoxyzzy"},{"email":"acdlite@me.com","name":"acdlite"}],"time":{"modified":"2022-06-26T10:24:22.597Z","created":"2015-07-03T04:56:29.408Z","0.1.0":"2015-07-03T04:56:29.408Z","0.2.0":"2015-07-03T19:16:08.120Z","0.3.0":"2015-07-07T19:42:22.117Z","0.4.0-alpha":"2015-07-22T22:19:55.776Z","0.4.0":"2015-08-26T21:52:17.723Z","0.5.0":"2015-11-09T03:33:51.164Z"},"keywords":["redux","observable","middleware","redux-middleware","rxjs","rx","reactive","fsa","flux"],"author":{"name":"Andrew Clark","email":"acdlite@me.com"},"license":"MIT","readmeFilename":"README.md","users":{"yatsu":true,"marcuswhit":true,"hal9zillion":true},"homepage":"https://github.com/acdlite/redux-rx","bugs":{"url":"https://github.com/acdlite/redux-rx/issues"},"repository":{"type":"git","url":"git+https://github.com/acdlite/redux-rx.git"}}