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

26 lines
509 B
JavaScript
Raw Normal View History

'use strict';
2015-05-26 10:41:41 +02:00
import alt from '../alt';
import PieceFetcher from '../fetchers/piece_fetcher';
class PieceActions {
constructor() {
this.generateActions(
'updatePiece'
);
}
fetchOne(pieceId) {
PieceFetcher.fetchOne(pieceId)
.then((res) => {
this.actions.updatePiece(res.piece);
})
.catch((err) => {
console.log(err);
2015-05-26 10:41:41 +02:00
});
}
2015-05-26 13:33:35 +02:00
}
2015-05-26 10:41:41 +02:00
export default alt.createActions(PieceActions);