DEV: Make publishToMessageBus() wait for settled (#17575)

So you can just `await publishToMessageBus()` instead of following it with `await settled()` every time.
This commit is contained in:
Jarek Radosz 2022-07-19 22:59:52 +02:00 committed by GitHub
parent 2159637e4d
commit a4e5bd272a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -484,11 +484,13 @@ export function exists(selector) {
return count(selector) > 0;
}
export function publishToMessageBus(channelPath, ...args) {
export async function publishToMessageBus(channelPath, ...args) {
args = cloneJSON(args);
MessageBus.callbacks
.filterBy("channel", channelPath)
.forEach((c) => c.func(...args));
await settled();
}
export async function selectText(selector, endOffset = null) {