In RxJS, methods that transform or query sequences are called operators. Operators are found in the static Rx.Observable object and in Observable instances. In our example, create is one such operator.
In an RxJS program, we should strive to have all data in Observables, not just data that comes from asynchronous sources. Doing that makes it easy to combine data from different origins, like an existing array with the result of a callback, or the result of an XMLHttpRequest with some event triggered by the user. For example, if we have an array whose items need to be used in combination with data from somewhere else, it’s better to make this array into an Observable. (Obviously, if the array is just an intermediate variable that doesn’t need to be combined, there is no need to do that.
PS> C:\User> ./run.bash
-
What is an Subject? Could you list out and explain all of them?
-
AsyncSubject
- If ( lastEmmit )
- stream 1: ----1----2-----3----|--->
- stream 2: subscribe(t=t/2) ⇫----3----|--->
- stream 3: subscribe(t=0) ⇫--------------3----|--->
- Else
- stream 1: ----1----2-----X----|--->
- stream 2: subscribe(t=t/2) ⇫----X----|--->
- stream 3: subscribe(t=0) ⇫--------------X----|--->
-
BehaviorSubject
- If ( lastEmmit )
- stream 1: BehaviorSubject (4) ----1----2-----3----|--->
- stream 2: subscribe(t=0) ⇫-4-1----2-----3----|--->
- stream 3: subscribe(t=t/2) ⇫ 2-3----|--->
- Else if( Observable terminates with an error)
- stream 1: BehaviorSubject (4) --1---X------------|--->
- stream 2: subscribe(t=t/2) ⇫----X----|--->
- stream 3: subscribe(t=0) ⇫--4-1-X------------|--->
-
PublishSubject
- If ( lastEmmit )
- stream 1: ----1----2-----3----|--->
- stream 2: subscribe(t=0) ⇫--1----2-----3----|--->
- stream 3: subscribe(t=t/2) ⇫--3----|--->
- Else if( Observable terminates with an error)
- stream 1: BehaviorSubject (4) --1---2------X-----|--->
- stream 2: subscribe(t=t/2) ⇫---X-----|--->
- stream 3: subscribe(t=0) ⇫--1---2------X-----|--->
-
ReplaySubject
- If ( lastEmmit )
- stream 1: ----1----2-----3----|--->
- stream 2: subscribe(t=0) ⇫--1----2-----3----|--->
- stream 3: subscribe(t=t/2) ⇫123----|---> OR ⇫1--23--|--->
- Else if( Observable terminates with an error)
- stream 1: BehaviorSubject (4) --1---2------X-----|--->
- stream 2: subscribe(t=t/2) ⇫---X-----|--->
- stream 3: subscribe(t=0) ⇫--1---2------X-----|--->
-
-
Could you explain core pattern of Reactive Programing?
-
What different between Reactor Pattern vs Observer Pattern?
-
When do you use Subject and when not? http://davesexton.com/blog/post/To-Use-Subject-Or-Not-To-Use-Subject.aspx
-
Please explain what are " Builder Pattern" how was that cooperate with RX?
-
Could I call observer by “subscriber,” “watcher,” or “reactor.”?
-
What are “Hot” and “Cold” Observables?
-
What is “Connectable” Observable?
-
Please implement Proactor pattern by JS?
-
Could you list out 10 concurrency pattern?
-
Creating Observables](operators.html#creating)
Create
,Defer
,Empty
/Never
/Throw
,From
,Interval
,Just
,Range
,Repeat
,Start
, andTimer
-
Transforming Observable Items](operators.html#transforming)
Buffer
,FlatMap
,GroupBy
,Map
,Scan
, andWindow
-
Filtering Observables](operators.html#filtering)
Debounce
,Distinct
,ElementAt
,Filter
,First
,IgnoreElements
,Last
,Sample
,Skip
,SkipLast
,Take
, andTakeLast
-
Combining Observables](operators.html#combining)
And
/Then
/When
,CombineLatest
,Join
,Merge
,StartWith
,Switch
, andZip
-
Error Handling Operators](operators.html#error)
Catch
andRetry
-
Utility Operators](operators.html#utility)
Delay
,Do
,Materialize
/Dematerialize
,ObserveOn
,Serialize
,Subscribe
,SubscribeOn
,TimeInterval
,Timeout
,Timestamp
, andUsing
-
Conditional and Boolean Operators](operators.html#conditional)
All
,Amb
,Contains
,DefaultIfEmpty
,SequenceEqual
,SkipUntil
,SkipWhile
,TakeUntil
, andTakeWhile
-
Mathematical and Aggregate Operators](operators.html#mathematical)
Average
,Concat
,Count
,Max
,Min
,Reduce
, andSum
-
Converting Observables](operators.html#conversion)
To
-
Connectable Observable Operators](operators.html#connectable)
Connect
,Publish
,RefCount
, andReplay
-
Backpressure Operators](operators/backpressure.html) a variety of operators that enforce particular flow-control policies