Where would you implement the api call to persist data to the key-value store (firebase).
2 options:
1. actions/counter-actions.js
incrementCounter: (id, count) => {
let incrementedCount = count + 1;
counterWebApiUtils.updateCounter(id, incrementedCount).on('value', (data) => {
Dispatcher.dispatch({
actionType: counterConstants.INCREMENT_COUNTER,
count: data.val(),
id
});
});
},
2. stores/counter-store.js (like it is right now) counterWebApiUtils.updateCounter(payload.id, payload.count).on('value', () => {
counters[payload.id].count = payload.count;
counterStore.emitChange();
});