Skip to content

Proposal: Add support for observable spec interop point #1631

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
benlesh opened this issue Apr 18, 2016 · 2 comments · Fixed by #1632
Closed

Proposal: Add support for observable spec interop point #1631

benlesh opened this issue Apr 18, 2016 · 2 comments · Fixed by #1632

Comments

@benlesh
Copy link
Contributor

benlesh commented Apr 18, 2016

Per the stage 1 observable proposal, there is an interop point that can be added for types that are "observable". It's as simple as adding a [Symbol.observable]() hook that returns a basic observable (it doesn't have to be Rx-based or anything).

Pros

  1. Adding this hook will enable interoperability with RxJS 5, and it should do the same for Kefir, Bacon, Most, and others.
  2. People can stop asking me "what's the difference between RxJS and redux?"
  3. People that want to use a more reactive methodology for delivering state to components can do so without forgoing the wonderful tooling this community has put together
  4. It's a relatively minimal change

Cons

Need to include a small Symbol.observable shim. Should probably add some integration test to a common library which adds one development-time dependency.

attn/ @gaearon @zenparsing

benlesh added a commit to benlesh/redux that referenced this issue Apr 18, 2016
- Adds `Symbol.observable` method to the store that returns a generic observable
- Adds tests to ensure interoperability. (rxjs 5 was used for a simple integration test, and
  is a dev only dependency)

closes reduxjs#1631
@gaearon
Copy link
Contributor

gaearon commented Apr 18, 2016

Looks 👍 to me!

benlesh added a commit to benlesh/redux that referenced this issue Apr 18, 2016
- Adds `Symbol.observable` method to the store that returns a generic observable
- Adds tests to ensure interoperability. (rxjs 5 was used for a simple integration test, and
  is a dev only dependency)

closes reduxjs#1631
benlesh added a commit to benlesh/redux that referenced this issue Apr 19, 2016
- Adds dependency on `symbol-observable` to pull in `Symbol.observable`
- Adds `Symbol.observable` method to the store that returns a generic observable
- Adds comprehensive tests to ensure interoperability. (rxjs 5 was used for a simple integration test, and
  is a dev only dependency)

closes reduxjs#1631
benlesh added a commit to benlesh/redux that referenced this issue Apr 19, 2016
- Adds dependency on `symbol-observable` to pull in `Symbol.observable`
- Adds `Symbol.observable` method to the store that returns a generic observable
- Adds comprehensive tests to ensure interoperability. (rxjs 5 was used for a simple integration test, and
  is a dev only dependency)

closes reduxjs#1631
gaearon pushed a commit that referenced this issue Apr 19, 2016
- Adds dependency on `symbol-observable` to pull in `Symbol.observable`
- Adds `Symbol.observable` method to the store that returns a generic observable
- Adds comprehensive tests to ensure interoperability. (rxjs 5 was used for a simple integration test, and
  is a dev only dependency)

closes #1631
@xirzec
Copy link

xirzec commented May 12, 2016

This dependency seems to break using Redux with TypeScript and webpack: TypeStrong/ts-loader#192

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants