You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is very strange that the Binding type is in the SwiftUI framework.
Assuming that Binding needs to be used only in View.
It turns out that in the ViewModel it is necessary to use CurrentValueSubject in the Binding place.
That is something like this: typealias LoadableSubject<Value> = CurrentValueSubject<Loadable<Value>, Never>
But how to link Published and CurrentValueSubject?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
It is very strange that the
Binding
type is in theSwiftUI
framework.Assuming that
Binding
needs to be used only inView
.It turns out that in the
ViewModel
it is necessary to useCurrentValueSubject
in theBinding
place.That is something like this:
typealias LoadableSubject<Value> = CurrentValueSubject<Loadable<Value>, Never>
But how to link
Published
andCurrentValueSubject
?Beta Was this translation helpful? Give feedback.
All reactions