fluxxor
fluxxor copied to clipboard
In the Async Example not clear how to support add action which needed to call out to server
In the example http://fluxxor.com/guides/async-data.html the addaction updates the list locally. Let say the list has many users adding to it so the add method would need to reload the list with its entry updated. How would that be done, since the actions shouldn't initiate other actions .
Why not just modify the ADD_BUZZ_SUCCESS event so that it doesn't accept the id of submitted item, but the list (of all items, retrieved from server). And onAddBuzzSuccess smth like this:
onAddBuzzSuccess: function(payload) {
this.words = payload.updatedWord;
this.emit("change");
},