MVVM Messenger | Remove Duplicates or Duplicate Detection #471
-
I would like to know if the MVVM Messenger can be configured to detect duplicate messages and then perform action based on the last message. My scenario is that sometimes the same event is invoked several times and I want to reduce the overhead of the messenger up to the last message. I know that it might need to add timespan parameters so the messenger would wait for one second for example and then removes duplicated messages and send the last one? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
This is not something that's supported by either of the built-in messenger types, but you could build your own messenger as a type that wraps one of the built-in message types and adds the appropriate debouncing logic when a message is sent, and then just forwards messages to the inner message object. This way you won't have to reimplement any of the actual broadcasting logic. |
Beta Was this translation helpful? Give feedback.
This is not something that's supported by either of the built-in messenger types, but you could build your own messenger as a type that wraps one of the built-in message types and adds the appropriate debouncing logic when a message is sent, and then just forwards messages to the inner message object. This way you won't have to reimplement any of the actual broadcasting logic.