Skip to content

Provide default IO/SyncIO error handler for component #1084

Description

@matthughes

Maybe this is already possible but I'd love to be able to have a default error handler for any IO/SyncIO/Callback effect. Something like:

    ScalaComponent
      .builder[Props]("MyComponent")
      .initialState(State.Initial)
      .renderBackend[Backend]
      .onError(s => s.backend.handleError(s.error))

This would be akin to adding.onError to every effect you submit (onClick/componentDidMethods). I have to believe there is a way to do this with the Dispatch/Effect classes but can't quite figure it out. Would be great to have a more ergonomic way though. If someone could generally point my in a direction I can try to submit a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions