fancy_stream 1.3.1+6
fancy_stream: ^1.3.1+6 copied to clipboard
A sophisticated way to use streams, make it even easier to use.
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!");
final values = valuesToMap<String>();
printWhenDispatchedValue(values.toString());
///Clean all Subjects, Subscrtiption and instances generated
dispose();
}
void printWhenDispatchedValue(String value) {
print(value);
}
}