RxJS, which does not imply familiarity with reactive programming concepts or Rx.NET?

I'm trying to wrap my head around how RxJS works, and if that suits my needs, but every article I come across suggests that the reader is already familiar with the concepts of reactive programming or has knowledge of the .NET version.

Is there any material that focuses on the average JavaScript developer?

+4
source share
4 answers

The RxJS practice lab is pretty decent, albeit a bit dated. http://go.microsoft.com/fwlink/?LinkId=208527 for example, you need to add a couple of extensions to work with toObservable () to attach to events and no longer use the removeTimestamp () function.

/** * Creates an observable sequence by adding an event listener to the matching jQuery element * * @param {String} eventName The event name to attach the observable sequence. * @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next. * @returns {Observable} An observable sequence of events from the specified element and the specified event. */ jQuery.fn.toObservable = function(eventName, selector) { return Rx.Observable.fromEvent(this, eventName, selector); }; Rx.Observable.prototype.logTimestampedValues = function(onNext) { return this.timestamp().do(onNext).select(function(t) { return t.value; }); }; 

I borrowed from RemoveTimestamp Rx (deleted but not forgotten) to fix logTimestampedValues.

I suggest watching the video on the MSDN Beginner's Guide page, in particular Rx Workshop videos. It may take a few glances, but you will get there.

The video that brought RX to my attention was in InfoQ. I feel that this is a good idea of โ€‹โ€‹how it can be used, and it can help you more easily fool the concept (s). http://www.infoq.com/presentations/Netflix-API-rxjava-hystrix

+1
source

I found that a former Microsoft employee is now collaborating with Netflix Jafar Husain with the interactive tutorials they use at Netflix to teach RxJS their new employees how to be very helpful.

The good thing about this is that it does not involve any familiarity with either functional or reactive programming concepts. Textbooks can easily lead to an improvement in these concepts if you do not know either one or the other familiar, the other, or both. This makes it a great place to start, as both concepts are used in RxJS.

http://jhusain.imtqy.com/learnrx/

source: https://youtu.be/gawmdhCNy-A?t=38m6s

There is also an RxMarbles website that has interactive diagrams on how all RxJS methods work for observables. It shows how they work by illustrating events on the input and output timeline of any given RxJS method. You can drag events from left to right on the input timeline to understand how each method outputs and works.

It reads here as โ€œThe General Theory of Reactivityโ€ by Chris Kowal (he is the author of the Promise Q library). He was examined by his three peers Domenik Denikola, Ryan Paul and Kevin Smith. You can just read the Observed section, but overall it's great, but a little esoteric.

There is also this snippet in the WHATWG spec specification, about the difference between readable and observable streams.

Then there is the official documentation.

Another great resource is egghead.io , which contains 100 RxJS videos (at the time of this writing), and most of them are featured in courses. They are very good, (short and precise), but you need to pay a monthly fee for accessing some of them. You could check them all in one month without paying for anything.

+9
source

I personally found this wonderful tutorial https://gist.github.com/staltz/868e7e9bc2a7b8c1f754 very useful.

+3
source

Try viewing this: http://rx.codeplex.com/SourceControl/latest#Rx/JS/rx-vsdoc.js

This may not be what you are looking for, but it will give you the opportunity to wrap your head around various functions. It is assumed that it has a LINQ-esk approach, so if you want to find LINQ examples, for example http://code.msdn.microsoft.com/101-LINQ-Samples-3fb9811b , you may be able to understand how it works. Hope this helps.

0
source

Source: https://habr.com/ru/post/1487128/


All Articles