Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Trigger::dispose #2548

Open
luxalpa opened this issue Apr 22, 2024 · 0 comments
Open

Add Trigger::dispose #2548

luxalpa opened this issue Apr 22, 2024 · 0 comments

Comments

@luxalpa
Copy link
Contributor

luxalpa commented Apr 22, 2024

Is your feature request related to a problem? Please describe.
I currently use RwSignal<()> as a trigger because it allows me to dispose it manually. I don't see a reason why we wouldn't want to have that same functionality on Triggers.

Describe the solution you'd like

impl<T> SignalDispose for Trigger {
    fn dispose(self) {
        _ = with_runtime(|runtime| runtime.dispose_node(self.id));
    }
}

Describe alternatives you've considered
Currently I'm using RwSignal<()>. To be fair I am not sure if there's any actual advantages of using Trigger over RwSignal<()>

Additional context
I'm using this to implement my global state in some kind of subscriber-system where signals are being created ad-hoc only for the elements that are visible on the page instead of for the entirety of the global state (which can have a large number of objects).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants