Skip to content

Cell model closures should receive dataSource/delegate function params #102

@jessesquires

Description

@jessesquires

Most of the closures for cells at () -> Void
https://github.com/plangrid/ReactiveLists/blob/master/Sources/Typealiases.swift#L19-L32

Instead, the should receive the params from the method in which they are called, for example:
typealias DidSelectClosure = (tableView, indexPath) -> Void

It's not uncommon to need access to these values to perform certain operations.


Also of note:

Why not just define functions on the *CellViewModel` protocols? Seems like a much simpler design. No need for the typealiases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions