Anyone has a more detailed explanation?
Anyone has a more detailed explanation?
[1] http://www.confreaks.com/videos/3221-mwjs-be-predictable-not...
Flux is just Facebook's internal usage pattern. Doesn't really have an Angular equivalent other than the somewhat nebulous Angular best practices.
Technically, this is done by simply using an unique dirty bit, which triggers the recomputation of the rendered scene. Which is fast enough in practice, and even supports unchanged hints to reduce the costs of expensive DOM updates.
This is eerly similar to 3d scene rendering. The unchanged hints are the equivalent of viewport clipping, though require more work from the coder to setup right.
For instance: the directives `ng-show` and `ng-hide` simply apply CSS styles. As far as I know it's not possible to completely remove an Angular component from the DOM and then replace it later (without getting too deep into imperative JS). However, that's trivial to do in React.
Angular chokes on large data sets, probably because it's doing everything directly on the DOM. React handles huge numbers of records effortlessly. Getting comparable performance with Angular requires much more imperative voodoo than I'd like out of an ostensibly declarative system.
I also find it harder to reason about Angular's data flow, since there are many ways to pass things around: nested scope, isolate scope, sibling scope, same scope, dependency injection to name a few. Finding where a particular handler or value comes from is sometimes quite the hunt. With React, it's all pretty much self-contained.
Wouldn't ng-if be appropriate for this?
http://www.quora.com/Pete-Hunt/Posts/Facebooks-React-vs-Angu...
http://www.reddit.com/r/javascript/comments/1oo1y8
Though they're both from a member of the React team and might be a little biased, they were very informative.