The InfiniteLoader component from react-virtualized requires that the function be passed as the loadMoreRows property in order to have a type signature { startIndex: number, stopIndex: number }): Promise. I use shorthand in my project, so I am the loadMoreRowscreator of the action as a shorthand:
const fetchEntities(start, stop) {
return fetch(`${myUrl}&start=${start}?stop=${stop}`)
}
const loadMoreRows = ({ startIndex, stopIndex }) => {
return (dispatch, getState) => {
return function(dispatch) {
return fetchEntities(startIndex, stopIndex).then(
items => dispatch(simpleAction(items)),
error => console.log(error)
)
}
}
}
after that, this action is associated with the reactive component containing the InfiniteLoader using the join function from the reduct reduction.
So I'm not sure how I can satisfy the signature requirements, as the creators of action-action do not return any value /
source
share