Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "frontend-packages/cookie-consent-web-client/src/utils/ready"

Index

Variables

Const LISTEN_TO_EVENTS

LISTEN_TO_EVENTS: string[] = ["readystatechange","rocket-readystatechange","DOMContentLoaded","rocket-DOMContentLoaded","rocket-allScriptsLoaded"]

Listen to multiple events. Why? See same reason as in memorizedReadyStatePromises().

Functions

Const helperCreateResolvablePromise

  • helperCreateResolvablePromise(): [boolean, Promise<void>, () => void]
  • Returns [boolean, Promise<void>, () => void]

Const memorizeReadyState

  • memorizeReadyState(): void

Const ready

  • ready(fn?: () => void, state?: DocumentReadyState): Promise<void>
  • Wait DOM is ready depending on a state.

    • interactive: Defer scripts are executing, but DOM is ready
    • complete: All scripts including deferred ones are executed and DOM is ready
    see

    https://stackoverflow.com/a/65430734/5506547

    see

    https://stackoverflow.com/a/51980980/5506547

    Parameters

    • Optional fn: () => void
        • (): void
        • Returns void

    • Default value state: DocumentReadyState = "complete"

    Returns Promise<void>

Object literals

Const memorizedReadyStatePromises

memorizedReadyStatePromises: object

complete

complete: [boolean, Promise<void>, () => void] = helperCreateResolvablePromise()

interactive

interactive: [boolean, Promise<void>, () => void] = helperCreateResolvablePromise()

loading

loading: [boolean, Promise<void>, () => void] = helperCreateResolvablePromise()

Generated using TypeDoc