1
0
mirror of https://github.com/ascribe/onion.git synced 2025-02-14 21:10:27 +01:00
onion/js/stores/piece_list_store.js
2015-05-22 11:33:38 +02:00

27 lines
760 B
JavaScript

import alt from '../alt';
import PieceListActions from '../actions/piece_list_actions';
class PieceListStore {
constructor() {
this.pieceList = []; // rename this to pieceList after figuring out AltContainer transform
this.page = 1;
this.pageSize = 10;
this.search = "";
this.orderBy = "artist_name";
this.orderAsc = true;
this.bindActions(PieceListActions);
}
onUpdatePieceList({ page, pageSize, search, pieceList, orderBy, orderAsc }) {
this.page = page;
this.pageSize = pageSize;
this.search = search;
this.orderAsc = orderAsc;
this.orderBy = orderBy;
this.pieceList = pieceList;
}
};
export default alt.createStore(PieceListStore);