store: get composes using limit and offset
The composeGetAll action is refactored to composesGet. It now uses passes limit and offset as params so that pagination can be used. Also, the COMPOSE_ADDED reducer case only adds new compose ids to allIds if the id is new/unique.
This commit is contained in:
parent
122c392ca3
commit
4f58f6202a
3 changed files with 10 additions and 11 deletions
|
|
@ -43,7 +43,7 @@ class ImagesTable extends Component {
|
|||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.props.composeGetAll();
|
||||
this.props.composesGet(this.state.perPage, 0);
|
||||
this.interval = setInterval(() => this.pollComposeStatuses(), 8000);
|
||||
}
|
||||
|
||||
|
|
@ -140,14 +140,14 @@ function mapStateToProps(state) {
|
|||
|
||||
function mapDispatchToProps(dispatch) {
|
||||
return {
|
||||
composeGetAll: () => dispatch(actions.composeGetAll()),
|
||||
composesGet: (limit, offset) => dispatch(actions.composesGet(limit, offset)),
|
||||
composeGetStatus: (id) => dispatch(actions.composeGetStatus(id)),
|
||||
};
|
||||
}
|
||||
|
||||
ImagesTable.propTypes = {
|
||||
composes: PropTypes.object,
|
||||
composeGetAll: PropTypes.func,
|
||||
composesGet: PropTypes.func,
|
||||
composeGetStatus: PropTypes.func,
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue