32 lines
887 B
QML
32 lines
887 B
QML
|
|
// Auto-generated by `bin/console make:bridge:event TodoCompleted`.
|
||
|
|
// Listens for `app://event/todo-completed` envelopes published by
|
||
|
|
// TodoCompletedSubscriber and re-emits them as a typed QML signal.
|
||
|
|
//
|
||
|
|
// Drop into a parent component and connect:
|
||
|
|
//
|
||
|
|
// TodoCompletedEventHandler {
|
||
|
|
// onTodoCompleted: function(payload) { console.log("hi", payload) }
|
||
|
|
// }
|
||
|
|
|
||
|
|
import QtQuick
|
||
|
|
import PhpQml.Bridge
|
||
|
|
|
||
|
|
Item {
|
||
|
|
id: handler
|
||
|
|
|
||
|
|
/** Emitted when the bridge publishes app://event/todo-completed. */
|
||
|
|
signal todoCompleted(var payload)
|
||
|
|
|
||
|
|
MercureClient {
|
||
|
|
baseUrl: BackendConnection.url
|
||
|
|
token: BackendConnection.token
|
||
|
|
topics: ["app://event/todo-completed"]
|
||
|
|
|
||
|
|
onUpdate: function(topic, envelope) {
|
||
|
|
if (topic === "app://event/todo-completed") {
|
||
|
|
handler.todoCompleted(envelope.data)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|