mirror of
https://github.com/ascribe/onion.git
synced 2024-12-23 01:39:36 +01:00
23 lines
529 B
JavaScript
23 lines
529 B
JavaScript
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);
|