-
Notifications
You must be signed in to change notification settings - Fork 41
Description
Since the onInfiniteLoad callback currently needs to return a promise it seems to be difficult to work with Redux. I've worked around this by passing a deferred with the action but this feels hacky to me.
Has anyone else used this with Redux? We're using redux-observable instead of thunk so there aren't usually any promises to work with.
I think a more idiomatic solution would be to support tracking isInfiniteLoading with a prop rather than state so that the component can be told when loading is complete externally. The current behavior can be maintained by using a prop to switch between the current promise based + internal state behavior and being prop-driven. Backwards compatibility is simple by keeping the current behavior the default option.