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
2015-05-20 19:19:57 +02:00

24 lines
584 B
JavaScript

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