mirror of
https://github.com/ascribe/onion.git
synced 2024-12-22 17:33:14 +01:00
28 lines
651 B
JavaScript
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);
|