fluxxor icon indicating copy to clipboard operation
fluxxor copied to clipboard

In the Async Example not clear how to support add action which needed to call out to server

Open tirams opened this issue 8 years ago • 1 comments

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 .

tirams avatar Mar 04 '16 22:03 tirams

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");
 },

friendOfOurs avatar Jul 26 '16 09:07 friendOfOurs