First, init app. I called many Async Reflux Actions requests:
ExpenActions.loadAccounts();
WareActions.load();
ProdActions.load();
NotifActions.load();
It's all request created like this:
import Reflux from 'reflux';
const WareActions = Reflux.createActions({
load: { asyncResult: true },
});
onLoad() {
console.log("start load...")
return yajax.get(this._prefix+'warehouse/get').then(
Actions.load.completed,
Actions.load.failed);
},
onLoadCompleted(data) {
console.log("completed load", data);
this.setState({
rows: (data.success) ? data.data : [],
isLoaded: false
})
},
onLoadFailed() {
console.log("failed load");
},
I can wait for each request separately .. but how do I hang an event on when all events are finished?
Promise.all doesn't work.. because WareActions.load() returned undefined... not Promise..