event_stream_testabc 0.0.1 copy "event_stream_testabc: ^0.0.1" to clipboard
event_stream_testabc: ^0.0.1 copied to clipboard

An utility for reactive programming

event_stream #

An utility for reactive programming

Getting Started #

import 'package:event_stream/event_stream.dart';

void main() {

    EventStream stream = EventStream();

    stream.subscribe((String text) async {
        print('subscription: $text');
    });

    stream.add('hello world');
}

Custom Events #

You can subscribe to as many different types as you want. Note that a trigger should be immutable

class HelloWorld {
  final String message;
  HelloWorld(this.message);
}

class DoSomething { }

stream.subscribe((HelloWorld helloWorld) async {
    // business logic goes here
    print(helloWorld.message);
});

stream.subscribe((DoSomething doSomething) async {
    // business logic goes here
    print('do something event received');   
});

stream.add(HelloWorld('testing'));
stream.add(DoSomething());
0
likes
20
pub points
0%
popularity

Publisher

unverified uploader

An utility for reactive programming

Repository (GitHub)
View/report issues

License

BSD-3-Clause (LICENSE)

More

Packages that depend on event_stream_testabc