Skip to content

Commit 4489819

Browse files
committed
feat(servient): add removeClientFactory method
1 parent 841703d commit 4489819

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/src/core/servient.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,14 @@ class Servient {
202202
}
203203
}
204204

205+
/// Removes a [ProtocolClientFactory] matching the given [scheme] from this
206+
/// [Servient], if present.
207+
///
208+
/// If a [ProtocolClientFactory] was removed, the method returns it, otherwise
209+
/// the return value is `null`.
210+
ProtocolClientFactory? removeClientFactory(String scheme) =>
211+
_clientFactories.remove(scheme);
212+
205213
/// Checks whether a [ProtocolClient] is avaiable for a given [scheme].
206214
bool hasClientFor(String scheme) => _clientFactories.containsKey(scheme);
207215

0 commit comments

Comments
 (0)