local_pubsub

Last updated:

0 purchases

local_pubsub Image
local_pubsub Images
Add to Cart

Description:

local pubsub

local_pubsub #
A simple local pubsub library for Dart.
What you can do #
This library allows you to subscribe to different topics and send messages to all subscribers to this topic.

Subscribe to topic

void main() {
PubSub pubsub = PubSub();
Subscription? sub = pubsub?.subscribe('topic');
}
copied to clipboard

Unubscribe to topic

void main() {
PubSub pubsub = PubSub();
Subscription? sub = pubsub?.subscribe('topic');
pubsub?.unsubscribe(sub);
}
copied to clipboard

Publish message for topic

void main() {
PubSub pubsub = PubSub();
Subscription? sub = pubsub?.subscribe('topic');
sub?.stream?.listen((message) {
print(message);
});

pubsub?.publish('topic', 'hello');
}
copied to clipboard

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.