from https://github.com/Reactive-Extensions/RxJS-DOM/issues/105#issuecomment-173029716
Here's what we've already ported from Rx-DOM:
Observable.ajax, Observable.ajax.get, Observable.ajax.put, Observable.ajax.post, Observable.ajax.delete, Observable.ajax.getJSONObservable.webSocketScheduler.asapScheduler.animationFrameHere's what we're missing:
fromEvent](https://github.com/Reactive-Extensions/RxJS-DOM/blob/master/src/events/fromevent.js) with useCapture. Either we should change our current fromEvent to accept a useCapture boolean, or add a fromDOMEvent method.cc: @blesh @staltz @mattpodwysocki
@trxcllnt I'd be willing take fromReader.
I'm unsure how much value events adds. We do need a path to allowing useCapture with fromEvent, though.
I think we should do _something_ for requestIdleCallback. A Scheduler would be good, and/or perhaps an Observable creation method. It'll be really hard to polyfill well though. All of the polyfills I see wire events to mouse and keyboard activity and add some debouncing to it. I'm not sure that's _really_ the best way to handle it, but maybe it is.
@blesh it adds quite a bit in terms of being less terse. It's kind of like you could specify $('#foo').on('click', fn) or better yet $('#foo').click(fn) so discoverability is key here. Not only that, but to, based upon environment, add things like Touch and Pointer events.
I am very sorry for the following question:
I cannot find any rx-DOM code in bundles. I tried:
npm install rxjsWhat is the future of rx-DOM deployment?
@PavelPZ we're going to break it out into it's own package. The work is underway, but there's a lot to that. For now, you can find everything under Rx.KitchenSink.
@blesh, is there any news please? I thing that including all already ported DOM parts (ajax,websocket, animation frame) to your build process will be huge benefit for developers.
@PavelPZ we haven't had the time to get to it. Pulling apart a build process into different parts is a bit time consuming.
come on ! even ready isn't there why things are slow ?
@IDSFN come on ! requests pull welcome are.
<3 <3 <3
@blesh we don't need to make a request because everyone need rxjs DOM to be fully compatible with rxjs5 :D
is this function enough to accomplish what ready do, or there is some bad behaviour that I may see ?
thanks.
function ready(fn) {
if (document.readyState === 'complete')
setTimeout(fn, 0);
else
Rx.Observable
.fromEvent(document, 'DOMContentLoaded')
.subscribe(fn);
}
ready(view.init);
I've just ran into the issue of fromEvent not allowing the option/useCapture param. Is this still being looked into?
I can try and help get this in if I know the current direction (going into fromEvent direction, staying in Rx.DOM), though, not too familiar with the codebase, but willing to dig :)
I'm new to RxJS and would like to call an external API, if I understand correctly, I would use RxJS DOM JSONP for that. But it seems that is not available in RxJS 5 yet? Having a very hard time to find examples and tutorials or even the right community to ask questions in. Could any one give me soe directions?
@MrLoh there's a simple starting point for a JSONP observable here https://github.com/ReactiveX/rxjs/issues/2095#issuecomment-258023411
Someone asked how to do geolocation.currentPosition() in v5 on gitter, so I whipped this up quick...might help others who stumble upon this:
class CurrentPositionObservable extends Observable {
constructor(options) {
super();
this.options = options;
}
_subscribe(observer) {
window.navigator.geolocation.getCurrentPosition(
data => {
observer.next(data);
observer.complete();
},
e => observer.error(e),
this.options
);
}
}
const geolocation = {
currentPosition: options => new CurrentPositionObservable(options)
};
// use it how you would in v4 rx-dom
geolocation.currentPosition()
.subscribe(value => console.log(value);
Hopefully this also sheds some light on how easy it is to make custom Observables 馃槃
@trxcllnt I'd like to work on jsonp, if possible and nobody already started.
@martinjirku it's all yours 馃憤
I remember last discussion on core meeting about fate of Rx DOM implementation, so assigning @benlesh here to track further updates on those.
context: https://github.com/ReactiveX/rxjs-core-notes/blob/master/2017-03/march-27.md#splitting-dom-observables-off
@trxcllnt Is there a timeline to this thing? I am starting a project and I have to decide whether I can use RxJS 5 or not because I am going to use RxJS-DOM.
@AlokBansal8 which parts do you need?
I just came across a need for geolocation.watchPosition. In writing a first attempt at converting the RxJS 4 version I noticed that it does not seem to adhere to the spec. If I'm reading this correctly, watchPosition continues to emit values even if they are errors, but WatchPositionObservable unsubscribes on the first error. This seems like unexpected behavior per the spec.
For my use case, I do want to remain subscribed so I'm transforming the output and sending everything to next. Am I misinterpreting the spec here?
Closing as stale
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
@IDSFN come on ! requests pull welcome are.
<3 <3 <3