mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 02:50:00 +08:00
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:
parent
2159637e4d
commit
a4e5bd272a
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user