workflow-swift icon indicating copy to clipboard operation
workflow-swift copied to clipboard

WIP UI Observation with typed events

Open amorde opened this issue 2 years ago • 0 comments

Compare with https://github.com/square/workflow-swift/pull/208 and https://github.com/square/workflow-swift/pull/210

Pros

  • More concise observer protocol definition
  • Easily portable to other observation systems (ex. FRP frameworks) by passing the types through
  • Can easily be extended / customized to support listening to only a single event type
  • Adding fields to an existing event is backwards compatible
  • Adding new events is backwards compatible

Cons

  • No way to pattern match over a concrete list of possible events
  • Adding a new case to the enum is backwards incompatible
  • Does not match existing observation APIs for Workflow

amorde avatar May 11 '23 14:05 amorde