ListKeyStream<T> constructor
ListKeyStream<T> ({})
Create a ListKeyStream instance
Pass the convert
callback function to define how an AtKey and AtValue will converted into elements of the
list. To filter AtKeys that will be included in the list, 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
list with available keys that match the regex
, sharedBy
, and sharedWith
filters. To control how the stream
indexes the keys internally, you may pass a generateRef
function which takes an AtKey and AtValue and returns
the associated ref used for indexing (by default this is AtKey.key). You may also override the atClientManager
if necessary.
Implementation
ListKeyStream({
required T? Function(AtKey key, AtValue value) convert,
String? regex,
String? sharedBy,
String? sharedWith,
bool shouldGetKeys = true,
String Function(AtKey key, AtValue value)? generateRef,
FutureOr<void> Function(Object exception, [StackTrace? stackTrace])?
onError,
AtClientManager? atClientManager,
}) : super(
convert: convert,
regex: regex,
shouldGetKeys: shouldGetKeys,
sharedBy: sharedBy,
sharedWith: sharedWith,
generateRef: generateRef,
castTo: (values) => castTo<T>(values),
onError: onError,
atClientManager: atClientManager,
);