KeyStream<T> constructor

KeyStream<T>({
  1. required T? convert(
    1. AtKey key,
    2. AtValue value
    ),
  2. String? regex,
  3. String? sharedBy,
  4. String? sharedWith,
  5. bool shouldGetKeys = true,
  6. 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,
  );
}