Updating

public protocol Updating : UpdatesController

A base protocol for objects that can provide Update values periodically

  • debugUpdates(identifier:) Extension method

    prints out each update

    Declaration

    Swift

    func debugUpdates(identifier: String)
  • prints out each update

    Declaration

    Swift

    func debugUpdates(file: String = #file, line: UInt = #line, function: String = #function)
  • onUpdate(executor:_:) Extension method

    Subscribes for buffered and new update values for the channel

    Declaration

    Swift

    @discardableResult
    func onUpdate(
      executor: Executor = .primary,
      _ block: @escaping (_ update: Update) -> Void
      ) -> Self

    Parameters

    executor

    to execute block on

    block

    to execute. Will be called multiple times

    update

    received by the channel

  • Subscribes for buffered and new update values for the channel

    Declaration

    Swift

    @discardableResult
    func onUpdate<C: ExecutionContext>(
      context: C,
      executor: Executor? = nil,
      _ block: @escaping (_ strongContext: C, _ update: Update) -> Void
      ) -> Self

    Parameters

    context

    ExectionContext to apply transformation in

    executor

    override of ExecutionContexts executor. Keep default value of the argument unless you need to override an executor provided by the context

    block

    to execute. Will be called multiple times

    strongContext

    context restored from weak reference to specified context

    update

    received by the channel