BindingTarget

public struct BindingTarget<Value> : BindingTargetProvider

A binding target that can be used with the <~ operator.

  • Creates a binding target which consumes values on the specified scheduler.

    If no scheduler is specified, the binding target would consume the value immediately.

    Declaration

    Swift

    public init(on scheduler: Scheduler = ImmediateScheduler(), lifetime: Lifetime, action: @escaping (Value) -> Void)

    Parameters

    scheduler

    The scheduler on which the action consumes the values.

    lifetime

    The expected lifetime of any bindings towards self.

    action

    The action to consume values.

  • Creates a binding target which consumes values on the specified scheduler.

    If no scheduler is specified, the binding target would consume the value immediately.

    Declaration

    Swift

    public init<Object: AnyObject>(on scheduler: Scheduler = ImmediateScheduler(), lifetime: Lifetime, object: Object, keyPath: WritableKeyPath<Object, Value>)

    Parameters

    scheduler

    The scheduler on which the key path consumes the values.

    lifetime

    The expected lifetime of any bindings towards self.

    object

    The object to consume values.

    keyPath

    The key path of the object that consumes values.