vec buffer: send ListDiff::Clear before refilling vec with new values in with_data_arc_port()

This commit is contained in:
Michael Sippel 2024-09-02 00:11:12 +02:00
parent a795270515
commit af0d72df00
Signed by: senvas
GPG key ID: F96CF119C34B64A6

View file

@ -86,6 +86,7 @@ where
pub fn with_data_arc_port(data: Arc<RwLock<Vec<T>>>, port: InnerViewPort<RwLock<Vec<T>>>) -> Self {
port.set_view(Some(data.clone()));
port.notify(&VecDiff::Clear);
for x in data.read().unwrap().iter().cloned() {
port.notify(&VecDiff::Push(x));
}