remove method

V? remove(
  1. dynamic key
)

Removes a MultiKey and its associated value from the lookup table.

Returns the value associated with key before it was removed.

Returns null if key was not in the lookup table.

final lookup = WebSocketManagerLookup();

final key = MultiKey(['a', 'b', 'c']);
lookup[key] = 1000;

print(lookup.remove('a'));                // 1000
print(lookup.remove('b'));                // null
print(lookup.remove('c'));                // null

Implementation

V? remove(final dynamic key) {
  predicate(final K multiKey) => multiKey.contains(key);
  return _table.remove(_find(predicate)?.key);
}