From 34ecd2d541cc64182e07ed531e24dd7dc0a9a570 Mon Sep 17 00:00:00 2001 From: Michael Scofield Date: Fri, 3 Jan 2025 21:37:59 +0100 Subject: [PATCH] feat: add Dispose for Store (#3429) --- reactive_stores/src/lib.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/reactive_stores/src/lib.rs b/reactive_stores/src/lib.rs index fd1537a91a..d8a6c6dfa2 100644 --- a/reactive_stores/src/lib.rs +++ b/reactive_stores/src/lib.rs @@ -114,8 +114,8 @@ use reactive_graph::{ ArcTrigger, }, traits::{ - DefinedAt, IsDisposed, Notify, ReadUntracked, Track, UntrackableGuard, - Write, + DefinedAt, Dispose, IsDisposed, Notify, ReadUntracked, Track, + UntrackableGuard, Write, }, }; pub use reactive_stores_macro::{Patch, Store}; @@ -535,6 +535,15 @@ where } } +impl Dispose for Store +where + T: 'static, +{ + fn dispose(self) { + self.inner.dispose(); + } +} + impl ReadUntracked for Store where T: 'static,