11/// A loader protocol that represents an actual implementation of `ModifiedAtom`.
2- public struct ModifiedAtomLoader < Node: Atom , Modifier: AtomModifier > : AtomLoader where Node. Loader. Value == Modifier . Value {
2+ public struct ModifiedAtomLoader < Node: Atom , Modifier: AtomModifier > : AtomLoader where Node. Loader. Value == Modifier . BaseValue {
33 /// A type of value to provide.
4- public typealias Value = Modifier . ModifiedValue
4+ public typealias Value = Modifier . Value
55
66 /// A type to coordinate with the atom.
77 public typealias Coordinator = Void
@@ -15,19 +15,19 @@ public struct ModifiedAtomLoader<Node: Atom, Modifier: AtomModifier>: AtomLoader
1515 }
1616
1717 /// Returns a new value for the corresponding atom.
18- public func get ( context: Context ) -> Value {
18+ public func value ( context: Context ) -> Value {
1919 let value = context. transaction { $0. watch ( atom) }
20- return modifier. value ( context : context , with : value )
20+ return modifier. modify ( value : value , context : context . modifierContext )
2121 }
2222
23- /// Handles updates or cancellation of the passed value .
24- public func handle ( context : Context , with value : Modifier . ModifiedValue ) -> Modifier . ModifiedValue {
25- modifier. handle ( context : context , with : value )
23+ /// Associates given value and handle updates and cancellations .
24+ public func associateOverridden ( value : Value , context : Context ) -> Value {
25+ modifier. associateOverridden ( value : value , context : context . modifierContext )
2626 }
2727
2828 /// Returns a boolean value indicating whether it should notify updates to downstream
2929 /// by checking the equivalence of the given old value and new value.
30- public func shouldNotifyUpdate ( newValue: Modifier . ModifiedValue , oldValue: Modifier . ModifiedValue ) -> Bool {
31- modifier. shouldNotifyUpdate ( newValue: newValue, oldValue: oldValue)
30+ public func shouldUpdate ( newValue: Value , oldValue: Value ) -> Bool {
31+ modifier. shouldUpdate ( newValue: newValue, oldValue: oldValue)
3232 }
3333}
0 commit comments