1

I am looking for the best way of implementing event system in dart. My requirements are:

  1. I want to know event arguments when sending/listening events (nice to have code completion).
  2. Should be quite fast.
  3. Events may be global (I don't need the object-event connection).

It seems that using the streams is good way to go, but how to structure whole manager? I was thinking about something like:

class EventManager {
    Stream<Message1> onMessage1;
    Stream<Message2> onMessage2;
    Stream<Message3> onMessage3;
    (...)
}

but my intuition tells me that is rather bad way. Any advice?

1 Answer 1

2

The event_bus package IMHO contains exactly what you are looking for. Did you take a look? http://pub.dartlang.org/packages/event_bus (source on github)

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.