clear method
Clears the subscription set.
If unnamedOnly
is true
, then only unnamed subscriptions will be removed.
Implementation
void clear({bool unnamedOnly = false}) {
if (unnamedOnly) {
for (var i = length - 1; i >= 0; i--) {
final subscription = this[i];
if (subscription.name == null) {
remove(subscription);
}
}
} else {
_handle.clear();
}
}