mirror of
https://github.com/ascribe/onion.git
synced 2024-11-15 01:25:17 +01:00
27 lines
545 B
JavaScript
27 lines
545 B
JavaScript
'use strict';
|
|
|
|
import alt from '../alt';
|
|
import PieceFetcher from '../fetchers/piece_fetcher';
|
|
|
|
|
|
class PieceActions {
|
|
constructor() {
|
|
this.generateActions(
|
|
'updatePiece',
|
|
'updateProperty'
|
|
);
|
|
}
|
|
|
|
fetchOne(pieceId) {
|
|
PieceFetcher.fetchOne(pieceId)
|
|
.then((res) => {
|
|
this.actions.updatePiece(res.piece);
|
|
})
|
|
.catch((err) => {
|
|
console.logGlobal(err);
|
|
});
|
|
}
|
|
}
|
|
|
|
export default alt.createActions(PieceActions);
|