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
Intuitively, returning () or None from future passed to orders.perform_cmd(...) means that no message should be sent to Seed mailbox.
Similarly, orders.msg_sender()(None) should not send any message.
And in these cases rerender should not be triggered.
But it is done differently. This is stated in documentation of seed::app::App::update_with_option.
However from library user perspective there's no connection between update_with_option and perform_cmd.
I think, we should at least state this fact in documentation of perform_cmd and msg_sender, so other library users won't be surprised like I was and won't have to spend time on debugging like I had to.
My code looked like:
fnupdate(msg:Msg,model:&mutModel,orders:&mutimplOrders<Msg>){match msg {Msg::MyMsg => {
orders.perform_cmd(asyncmove{/* do sth that do not require rerender */;});
orders.after_next_render(|_| Msg::MyMsg);
orders.skip();}}}
After finishing async move { ... }, rendering is performed and async move { ... } is started again.
The text was updated successfully, but these errors were encountered:
orders.msg_sender() is for passing into other async functions so that you can communicate back to the Seed Event Loop. Otherwise it's morally and behaviourally identical to perform_cmd.
What exactly happened that defied your expectation?
What exactly happened that defied your expectation?
I had a future fut of type impl Future<Output = ()>. After running future fut (performed by orders.perform_cmd(fut)), rendering is triggered, although no message was sent and there is no mention about such behavior in the docs.
Intuitively, returning
()
orNone
from future passed toorders.perform_cmd(...)
means that no message should be sent to Seed mailbox.Similarly,
orders.msg_sender()(None)
should not send any message.And in these cases rerender should not be triggered.
But it is done differently. This is stated in documentation of
seed::app::App::update_with_option
.However from library user perspective there's no connection between
update_with_option
andperform_cmd
.I think, we should at least state this fact in documentation of
perform_cmd
andmsg_sender
, so other library users won't be surprised like I was and won't have to spend time on debugging like I had to.My code looked like:
After finishing
async move { ... }
, rendering is performed andasync move { ... }
is started again.The text was updated successfully, but these errors were encountered: