0

I am new on React and Flux and I am making an app that will have an input (like the name or the title), and below a list of n things.

How should I handle the event listeners? I saw in the TODO example of flux (https://github.com/facebook/flux/blob/master/examples/flux-todomvc/) that they use one change listener and emit an event with all the store state on every change.

Is that ok for a real app? If not, what could I do?

Facundo Matteo
  • 2,347
  • 2
  • 16
  • 19

1 Answers1

0

Yes, that is okay for a real app. It is typical to emit whole objects from stores even if it just so happens one of the listeners only needs a subset of the data. The idea is to keep it simple and avoid having to change the store when what the listener needs changes.

Cymen
  • 14,079
  • 4
  • 52
  • 72