Skip to content

Reusing Features in a RecyclerView #142

Description

@JonWatson

We have a variety of complicated cards to use in a RecyclerView and we would like to use a Feature for each card. The cards observe multiple Observable sources, and need to be disposed of properly when recycled/backgrounded/etc.

  1. Should we be calling .dispose() on a Feature that belongs to a card that is being recycled?

  2. Is there a way to re-use a Feature after it has been .disposed()? We would rather not have to allocate new Features in onBindViewHolder() as the object allocations can lead to GC/jank.

  3. How does the Binder that we use play into this? Do we need to call .dispose() on it as well? Or is that unnecessary if we are calling .dispose() on each bound Feature when it's no longer needed?

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions