1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-22 17:33:14 +01:00
onion/js/actions/contract_list_actions.js
2015-08-28 16:18:10 +02:00

28 lines
651 B
JavaScript

'use strict';
import alt from '../alt';
import OwnershipFetcher from '../fetchers/ownership_fetcher';
class ContractListActions {
constructor() {
this.generateActions(
'updateContractList',
'flushContractList'
);
}
fetchContractList() {
OwnershipFetcher.fetchContractList()
.then((contracts) => {
this.actions.updateContractList(contracts);
})
.catch((err) => {
console.logGlobal(err);
this.actions.updateContractList([]);
});
}
}
export default alt.createActions(ContractListActions);