@blackglory/wait-for
Version:
A module for waiting for things to happen.
14 lines (11 loc) • 358 B
text/typescript
import { fromMutationObserver } from '@utils/from-mutation-observer.js'
import { firstValueFrom } from 'rxjs'
export async function waitForDOMChanged(): Promise<void> {
const source = fromMutationObserver(document.documentElement, {
attributes: true
, characterData: true
, childList: true
, subtree: true
})
await firstValueFrom(source)
}