Use TC39 proposal for Symbol.observable to turn resources into Observables
See original GitHub issueThe idea is that instead of monkey patching resources into Observables, we should just implement Symbol.observable
on them and create an observable by passing them into Observable.from
.
For example,
import {Observable} from 'rxjs';
import app from './app'; // some feathers app
const messages = app.service('messages');
const messages$ = Observable.from(messages.find()); // messages.find() has a Symbol.observable member
messages$
.switchMap(/* whatever */)
// etc. ...
This removes the direct dependency on RxJS and moves toward the proposed standard. See the implementation in redux.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Observables - 🦋 Proposals - TC39 - Discourse
What work would it require to move forward with the proposal? If you want to propose an inter-op layer, it should be symbol-based....
Read more >es6/MiscJSDoc.js | RxJS API Document
* `Symbol.observable` is part of https://github.com/tc39/proposal-observable proposal. * Since currently it is not supported natively, and every symbol is equal ...
Read more >js-observables - npm Package Health Analysis
A completely custom implementation of ES7 (or ES8) Observables. With some sugar. Based on the proposal at tc39/proposal-observable.
Read more >Building Your Own Observable Part 3
In this installment, we're going to look at RxJS's take on the Observer ... He's also championing the TC39 proposal to add observables...
Read more >Is there a way to make a destructor for RXJS Observables?
You can optionally return a teardown function form the "subscribe function" passed to the constructor: return new Observable((observer) ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you! This would probably also solve #41. Would be nice to implement it with the next release but I might not get to look into this until after.
After a little more research (inhttps://github.com/feathersjs-ecosystem/feathers-reactive/tree/symbol-observable-latest), I think we can close this. @j2L4e’s implementation of a
.watch
method was the way to go here.