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
I just started using the Messenger. While following the documentation I created a new Message like this public class LoggedInUserChangedMessage : ValueChangedMessage<User>. This works perfectly find and makes a lot of sense to me.
Now I was wondering do I really need the LoggedInUserChangedMessage class or could I use the Messenger.Send method directly with the User class? Turns out, I can also call Messenger.Send(myNewUser). So both solutions work. The first adds clarity, but the second avoids an additional object.
So I see in this example that it makes a lot of sense to create the LoggedInUserChangedMessage as it adds additional clarity. But is this all the ValueChangedMessage was created for, or does it provide any additional benefits? I couldn't see anything in the code of ValueChangedMessage, but maybe I haven't figured out the overall concept?
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
Uh oh!
There was an error while loading. Please reload this page.
-
I just started using the
Messenger
. While following the documentation I created a new Message like thispublic class LoggedInUserChangedMessage : ValueChangedMessage<User>
. This works perfectly find and makes a lot of sense to me.Now I was wondering do I really need the
LoggedInUserChangedMessage
class or could I use theMessenger.Send
method directly with theUser
class? Turns out, I can also callMessenger.Send(myNewUser)
. So both solutions work. The first adds clarity, but the second avoids an additional object.So I see in this example that it makes a lot of sense to create the
LoggedInUserChangedMessage
as it adds additional clarity. But is this all theValueChangedMessage
was created for, or does it provide any additional benefits? I couldn't see anything in the code ofValueChangedMessage
, but maybe I haven't figured out the overall concept?Beta Was this translation helpful? Give feedback.
All reactions