Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does Reactive Framework differ from F# Events?

If I'm familiar with F# events already, and I don't plan to have too much C# interop, are there significant reasons to consider using the Reactive Framework?

like image 696
Rei Miyasaka Avatar asked Aug 23 '12 01:08

Rei Miyasaka


People also ask

What is the difference between reactive programming and functional programming?

Functional programming paradigm is built upon the idea that everything is a pure function. Reactive programming paradigm is built upon the idea that everything is a stream observer and observable philosophy.

What is a reactive framework?

Reactive frameworks, also known as reactive programming frameworks, are created with the express purpose of expressing application logic through streams that trigger what is known as side-effects.

Why is reactive programming better?

Simple to handle – a significant advantage of reactive programming is that it is simple to manage as a developer. Individual data streams can have code blocks added or removed, enabling you to make any necessary changes via the stream in question.

What is reactive programming example?

Reactive programming is a programming paradigm that deals with data flows and the propagation of change. It means that when a data flow is emitted by one component, the change will be propagated to other components by reactive programming library.


1 Answers

I think there are two main differences:

  • Firstly, there is a difference between the IEvent<'T> interface (and functions in the Event module) and the IObservable<'T> interface (used by functions from the Observable module and Reactive Fx). The difference has been discussed on SO earlier.

  • Reactive Framework is a more complex library, so it implements many combinators that are not available in F# in Observable or Event modules (although there is a open-source project that adds many of them)

The summary is, you should prefer functions from the Observable module. If it has everything you need, there is no need for Reactive Framework. If it does not, then you'll need either Reactive Framework or MiniRx (which, I believe, is sometimes more efficient too).

The F# Event module dates back to 2006, so I think Reactive Framework is clearly inspired by that, but it does not fully replace the F# functionality (mainly because it is not standard part of .NET or F# core).

like image 192
Tomas Petricek Avatar answered Sep 16 '22 12:09

Tomas Petricek