Skip to content

Commit

Permalink
chore(examples): add event subscribing to the main example
Browse files Browse the repository at this point in the history
  • Loading branch information
JKRhb committed Jan 27, 2024
1 parent fef513d commit cccca76
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ Future<void> main(List<String> args) async {
'"${thingDescription.title}"!',
);
print(consumedThing.thingDescription.events);
await consumedThing.subscribeEvent("change", print);
print("Incrementing counter ...");
await consumedThing.invokeAction("increment");
Expand Down
3 changes: 3 additions & 0 deletions example/example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ Future<void> main(List<String> args) async {
'"${thingDescription.title}"!',
);

print(consumedThing.thingDescription.events);
await consumedThing.subscribeEvent("change", print);

print("Incrementing counter ...");
await consumedThing.invokeAction("increment");

Expand Down

0 comments on commit cccca76

Please sign in to comment.