fancy_stream 1.0.1+2
fancy_stream: ^1.0.1+2 copied to clipboard
A sophisticated way to use streams, make it even easier to use, highly recommended for use in Bloc Pattern, as it contains functions for easy use of stream / sink dispatch / listen to work with stream [...]
example/example.dart
import 'package:fancy_stream/fancy_stream.dart';
class Example extends Disposable {
void main(List<String> args) {
//listen something on String, with key = "print"
listenOn<String>(printWhenDispatchedValue, key:"print");
dispatchOn<String>("Print that!", key: "print");
listenOn<String>(printWhenDispatchedValue);
dispatchOn<String>("Print that without key!");
///Clean all Subjects, Subscrtiption and instances generated
dispose();
}
void printWhenDispatchedValue(String value) {
print(value);
}
}