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
Exploring the idea of allowing a more independent and less condensed implementation, it would be interesting to add a ViewTransaction object of type Publisher and Hashable.
The use case I would like to explore is as follows: we have a "Continue" button and we want to notify externally when it is pressed. Following the TCA model, we continue to call the view store's send method to pass the Action.submit and handle this action in the reducer.
In the .submit case, we could use viewTransaction to notify that the submit happened and something external can occur, even enabling a screen transition outside the rules of TCA.
An example implementation of ViewTransaction could be:
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
-
Exploring the idea of allowing a more independent and less condensed implementation, it would be interesting to add a
ViewTransaction
object of type Publisher and Hashable.The use case I would like to explore is as follows: we have a "Continue" button and we want to notify externally when it is pressed. Following the TCA model, we continue to call the view store's
send
method to pass theAction.submit
and handle this action in the reducer.In the
.submit
case, we could useviewTransaction
to notify that the submit happened and something external can occur, even enabling a screen transition outside the rules of TCA.An example implementation of
ViewTransaction
could be:Then, in the external view, it is possible to make the following implementation:
And then in
submitScene
, I could do whatever I want within SwiftUI.The implementation of the State would be as follows:
Beta Was this translation helpful? Give feedback.
All reactions