Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is AngularJS Functional Reactive Programming?

Tags:

Every time I see the phrase Functional Reactive Programming I realize that I don't understand what it is. I then go back to this question, think I understand what it is, and the cycle repeats later.

Example isn't another way to teach, it is the only way to teach -Albert Einstein

Is Angular an example/implementation of FRP? Why or why not?

like image 429
Daniel Kaplan Avatar asked Jul 24 '13 22:07

Daniel Kaplan


People also ask

Is Angularjs reactive programming?

An Angular application is a reactive system. The user clicks on a button, the application reacts to this event and updates the model. The model gets updated, the application propagates the changes through the component tree. Angular implements these two arrows very differently.

Is angular functional programming?

Alongside React and Vue, Angular is considered to be one of the top JS UI frameworks. However, it differentiates itself through a couple of factors. Unlike the other top 2, it's a full-blown framework, coming with everything you'd want a framework to have.

Is functional programming same as reactive 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.

Is RxJs functional programming?

While RxJs is a functional programming library, it is also a reactive programming library. Reactive programming allows us to deal with the asynchronous nature of JavaScript in a seamless and very elegant manner.


1 Answers

I don't think it is. Angular is very much tied to states. In fact, if you watch a continuous function, you'll hit infinite recursion as the state is always dirty.

To make continuous functions work in the browser, the digest cycle needs to stop even when the state is dirty. Angular doesn't stop until the state is no longer dirty.

EDIT

Dart can be used for FRP though: http://victorsavkin.com/post/55007674849/functional-reactive-programming-in-dart

like image 98
John Tseng Avatar answered Oct 14 '22 00:10

John Tseng