سؤال

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?

هل كانت مفيدة؟

المحلول

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

نصائح أخرى

As John Tseng answered, AngularJS is NOT an example of FRP. You can, however, use FRP with AngularJS by using the angular-bacon module.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top