1
0
mirror of https://github.com/ascribe/onion.git synced 2024-11-15 09:35:10 +01:00
onion/js/actions/piece_list_actions.js

23 lines
529 B
JavaScript
Raw Normal View History

import alt from '../alt';
import PieceListFetcher from '../fetchers/piece_list_fetcher';
class PieceListActions {
constructor() {
this.generateActions(
'updatePieceList'
);
}
fetchPieceList() {
PieceListFetcher.fetch(1, 10)
.then((res) => {
this.actions.updatePieceList(res.pieces);
})
.catch((err) => {
console.log(err);
});
}
};
export default alt.createActions(PieceListActions);