Skip to content

Using with Redux #18

@meticoeus

Description

@meticoeus

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions