unsubscribe static method
Unsubscribes on the wire only when the LAST consumer of uri releases.
Implementation
static Future<void> unsubscribe(Client client, String uri) async {
final counts = _of(client);
final current = counts[uri] ?? 0;
if (current <= 1) {
counts.remove(uri);
await client.unsubscribeResource(uri);
return;
}
counts[uri] = current - 1;
}