Open cveering opened 1 year ago
This is a good question. I don't explicitly unsubscribe from filters and things seem to work. I've been assuming the filters get closed automatically during the process of dismounting. But your question has me wondering whether subscribed filters accumulate as the user navigates around the app? maybe leading to performance degradation or other problems?
Yeah, I wonder the same thing. I'm not far enough into an app yet to notice if it's racking up subs or dropping them when the component dismounts. A common use case has been loading profiles where I'd like to let the relays respond, and then unsubscribe. Maybe I'm making too much of these open subs, but they can rack up really fast with a decently sized list of users. I'm finding that when dealing with replaceable events, I generally want a straight up round trip query/response. So this is really about working around the lack of that.
unsubscribe
is not in the dependency array, is this normal ?
I might be going about this wrong, but I'd like to unsubscribe from filters when the component dismounts, or after some other event, doing something like:
Doing this, I get an error stating
unsubscribe is not a function
even though the type of unsubscribe is() => void
. What is the proper way to unsubscribe from a filter?Really nice work btw... It's been fun playing around with it. :-)