publish method
Implementation
void publish(String event, String? key, PublishParams? params) {
String eventKey = _buildEventKey(event, key);
if (params != null && params.isSticky == true && params.data != null) {
stickyDataMap[eventKey] = params.data!;
}
List<TUIObserver>? observers = observerMap[eventKey];
if (observers != null) {
NotifyParams? notifyParams;
if (params != null && (params.data != null || params.callback != null)) {
notifyParams = NotifyParams(data: params.data, callback: params.callback);
}
for (final observer in observers) {
observer.onNotify(event, key, notifyParams);
}
}
}