KeyStream<T> constructor
KeyStream<T> ({
- required T? convert(),
- String? regex,
- bool shouldGetKeys = true,
- AtClientManager? atClientManager,
Create a KeyStream instance
Pass the convert
callback function to define how an AtKey and AtValue will converted into elements of the
stream. To filter AtKeys that will be included in this stream, you may apply a custom regex
filter, or pass in
sharedBy
and/or sharedWith
atSigns. By default shouldGetKeys
is enabled, which will initially populate the
stream with available keys that match the regex
, sharedBy
, and sharedWith
filters. You may also override
the atClientManager
if necessary.
Implementation
factory KeyStream({
required T? Function(AtKey key, AtValue value) convert,
String? regex,
String? sharedBy,
String? sharedWith,
bool shouldGetKeys = true,
AtClientManager? atClientManager,
}) {
return KeyStreamImpl(
regex: regex,
convert: convert,
sharedBy: sharedBy,
sharedWith: sharedWith,
shouldGetKeys: shouldGetKeys,
atClientManager: atClientManager,
);
}