LensSubject
public final class LensSubject<A, B>: SubjectType
Enables reactive read and copy-on-write access for an entity’s property in a datastructure. Applies a given Lens to a subject.
-
Creates a subject that describes only a property of a given data structure.
Parameter
Parameter initial: The initial value to be used.Parameter
Parameter source: The observable that emits the data structure.Parameter
Parameter target: The observer for data structure.Parameter
Parameter lens: The lens for property access.Declaration
Swift
public init<S: ObservableType, O: ObserverType>(initial: A, source: S, target: O, lens: Lens<A, B>) where S.E == A, O.E == A
Parameters
initial
The initial value to be used.
source
The observable that emits the data structure.
target
The observer for data structure.
lens
The lens for property access.
-
Undocumented
Declaration
Swift
public final class LensSubject<A, B>: SubjectType
-
Undocumented
Declaration
Swift
public final class LensSubject<A, B>: SubjectType
-
Undocumented
Declaration
Swift
public final class LensSubject<A, B>: SubjectType
-
Creates a subject that describes only a property of a given data structure.
Parameter
Parameter initial: The initial value to be used.Parameter
Parameter subject: The subject that will be lensed.Parameter
Parameter lens: The lens for property access.Declaration
Swift
public convenience init<S: SubjectType>(initial: A, subject: S, lens: Lens<A, B>) where S.SubjectObserverType.E == A, S.E == A
Parameters
initial
The initial value to be used.
subject
The subject that will be lensed.
lens
The lens for property access.
-
Creates a subject that describes only a property of a given data structure.
Parameter
Parameter subject: The behavior subject that will be lensed. The current value will be used initially.Parameter
Parameter lens: The lens for property access.Declaration
Swift
public convenience init(subject: BehaviorSubject<A>, lens: Lens<A, B>) throws
Parameters
subject
The behavior subject that will be lensed. The current value will be used initially.
lens
The lens for property access.