When using React and Flux, it's standard practice to make API calls from actions, and then store the resulting data in a Store class. But who should be responsible for transforming that data after it's been stored?
Example: I've got an EntryStore
that keeps hold of objects representing shopping list items. I have a number of filters that I can apply to them (e.g "show only dairy
"). I currently have this working by calling EntryActions.filterEntries('dairy')
, which the dispatcher then passes to EntryStore
where a _filterEntries(tag)
method transforms theEntryStore._entries
array. Is this considered best practice? Should the action itself transform the list of entries, then pass it to EntryStore
to simply save? How dumb should the Store be in this case?