Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
wallforfry committed May 9, 2020
1 parent 358cac9 commit 4484ba2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ import 'package:dart_mercure/dart_mercure.dart';
main() {
// Token generate with "mercure" JWT_KEY
String token = "YOUR_JWT_TOKEN";
String hub_url = "http://MERCURE_HUB_URL/hub";
String topic = "http://YOUR_TOPIC/FOO";
var token = 'YOUR_JWT_TOKEN';
var hub_url = 'http://MERCURE_HUB_URL/hub';
var topic = 'http://YOUR_TOPIC/FOO';
Mercure mercure = Mercure(token: token, hub_url: hub_url);
var mercure = Mercure(token: token, hub_url: hub_url);
// Subscribes to topics
mercure.subscribeTopics(topics: <String> [topic, "ANOTHER_TOPIC"], onData: (Event event) {
mercure.subscribeTopics(topics: <String> [topic, 'ANOTHER_TOPIC'], onData: (Event event) {
print(event.data);
});
Expand All @@ -37,9 +37,9 @@ main() {
});
// Publish on topic
mercure.publish(topic: topic, data: "DATA").then((status) {
mercure.publish(topic: topic, data: 'DATA').then((status) {
if(status == 200) {
print("Message Sent");
print('Message Sent');
}
else {
print('Message Failed with code : $status');
Expand Down

0 comments on commit 4484ba2

Please sign in to comment.