Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ReactiveUI (RxUI) vs Reactive Extensions

Tags:

From http://docs.reactiveui.net/en/index.html :

ReactiveUI is a MVVM framework that allows you to use the Reactive Extensions for .NET to create elegant, testable User Interfaces that run on any mobile or desktop platform.

Is RxUI somehow differs from Reactive Extensions?

Why should I prefer RxUI over MVVMCross/light+Rx? What so special? Can RxUI do something that Rx can't? Is it more concise? Is it more cozy?

I saw example on github page https://github.com/reactiveui/ReactiveUI#a-compelling-example. But can't I do the same with just Rx?

P.S. Is there API doc somewhere?

like image 858
tower120 Avatar asked Jan 11 '16 17:01

tower120


People also ask

What framework is ReactiveUI based on?

ReactiveUI is a composable, cross-platform model-view-viewmodel framework for all . NET platforms, that is inspired by functional reactive programming.

What is reactive UI design?

In summary, reactive web design is a set of techniques that can be used to build sites that always feel fast and responsive to user input regardless of the network speed or latency.


1 Answers

You have included here lots of questions, so I'll answer them one by one.

Is RxUI somehow differs from Reactive Extensions?

Yes. Reactive Extensions is "a library for composing asynchronous and event-based programs by using observable sequences and LINQ-style query operators." It has nothing to do with UI specifically. Rx provides you a general abstraction over a stream of data.

RxUI is an MVVM framework, which means it is a library of classes helping you implement MVVM pattern in your app.

Can RxUI do something that Rx can't? Is it more concise? Is it more cozy?

It serves a different purpose. Rx provides a set of methods, which are generally helping you move the data in your app around. RxUI is used to create User Interfaces. It uses Rx under the hood, and also exposes Rx-type API (namely, IObservable<T>) from it's components.

For example, an ICommand implementation in ReactiveUI, called ReactiveCommand, exposes a property called ThrownException, which is of type IObservable<Exception> (you can read it as "a sequence of errors").

Note that while the IObservable<T> interface type is part of the .Net Base Class Library, literally all the useful functions operating with this type are included in the Reactive Extensions library.

But can't I do the same with just Rx?

No, because - for instance - Rx does not provide you with an ICommand implementation, a vital part of every MVVM framework.

Why should I prefer RxUI over MVVMCross/light+Rx? What so special?

If you want to use Reactive Extensions a lot in your app, you might prefer to use RxUI (rather than other MVVM framework) because they integrate really well with each other. Combined, they provide you with a lot of functionality out of the box (check out, for example, ReactiveCommand or WhenAny.

That being said, as the creator of RxUI stated it:

you can use ReactiveUI alongside other MVVM frameworks, you don't need to commit to one or the other. Many methods in RxUI such as WhenAny work on any object and determine at runtime how to best connect to them.

RxUI is definitely a Buffet Table (take what you want!), not a seven-course meal :)

And, finally:

P.S. Is there API doc somewhere?

Yes there is! Take a look here: https://reactiveui.net/api/

As a side note, feel free to browse Reactive Programming section of the docs, which will explain you some of the basic terminology and concepts standing behind the framework :)

like image 102
pmbanka Avatar answered Oct 13 '22 01:10

pmbanka