Skip to content

Add onStart callback to SwiftUI.LazyImage #727

@larryonoff

Description

@larryonoff

Please add onStart to SwiftUI.LazyImage.

See an example below.

  @State private var isLoading: Bool = false

    Button {
      viewStore.send(.tapped)
    } label: {
        LazyImage(url: viewStore.imageURL) { state in
           ...
        }
        .onStart { isLoading = true }
        .onCompletion { _ in isLoading = false }
    }
    .disabled(isLoading)

Metadata

Metadata

Assignees

No one assigned

    Labels

    improvementNon-functional change that improves existing functionality

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions