Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

246
Visualizações
What's the crucial difference between Angular 2 Data Flow and Flux?

Hi I am studying Angular 2 and React + Redux right now, and I have a question on the difference of the difference in data flow of those two choices.

  1. Angular 2 uses uni-directional data flow by default. Redux is a Flux implementation, which (also) uses uni-directional data flow. What is the crucial difference among those? (is it maybe, the composition of parts?)
  2. If those two are not so much different in terms of how data flows, why would anyone use Flux or Redux over default choice of Angular 2 framework?
  3. If those two are quite different, is there a name I can call for Angular 2's data flow for further references to compare those two?

Thanks a lot in advance !

over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

If those two are not so much different in terms of how data flows, why would anyone use Flux or Redux over default choice of Angular 2 framework?

Angular mostly provides UI layer (components) while the state management is not predefined by the framework. Since angular has services, you can keep the business logic in services (stateful services) and UI state in components (stateful components), but it means that there is no single place for the state as it is distributed among services/components.

The main reason to use redux in angular application is to separate UI layer from the data layer. In redux, the state is separated into a separate layer (think single tree-like object) which gets synchronized with UI layer (components) through special services injected into components constructor (check this setup).

If those two are quite different, is there a name I can call for Angular 2's data flow for further references to compare those two?

I haven't come across one, probably because as I mentioned above angular as a framework is focused on presentation, not state.

over 4 years ago · Santiago Trujillo Relatório

0

By using Redux with angular 2, you are centralizing your application state in a single place totally seperate from your components: the store.

Your components can then be stateless, allowing you to disable internal change detection on them like this.

@Component({
  changeDetection: ChangeDetectionStrategy.OnPush
})
class myComponent {
  @Input() inputFromTheStore: Observable<State>;
}

Indeed the above example is a stateless component, on wich you plug in a stream of state.

Also to answer your question :

Angular 2 uses uni-directional data flow by default. Redux is a Flux implementation, which (also) uses uni-directional data flow. What is the crucial difference among those? (is it maybe, the composition of parts?)

The crucial difference is that with Redux the state will always be coming in from above via @Input(). Unlike traditional angular2 statefull components where state could transit through @Input() and @Output().

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda