Skip to content
This repository was archived by the owner on Aug 13, 2021. It is now read-only.
This repository was archived by the owner on Aug 13, 2021. It is now read-only.

Interactions appear to be misbehaving when multiple subscriptions are made #103

@jverkoey

Description

@jverkoey

While implementing the visualize operator I encountered problems with some interactions behaving incorrectly when multiple subscriptions were made to the upstream.

The original implementation looked like so:

let visualizationSubscription = self.asStream().toString().dedupe().subscribeToValue { value in
  label.text = (prefix ?? "") + stringValue

  highlight.alpha = 1
  UIView.animate(withDuration: 0.3) {
    highlight.alpha = 0
  }
}

let subscription = self.asStream().subscribeAndForward(to: observer)

return {
  visualizationSubscription.unsubscribe()
  subscription.unsubscribe()
}

But this caused the contextual transition demo to behave incorrectly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions