Properties
Private
Optional
enter
enter?: ((match) => Promise<void>)
Type declaration
-
- (match): Promise<void>
-
Returns Promise<void>
Private
ignoreMatchError
ignoreMatchError: boolean = false
Private
ignoreWaitError
ignoreWaitError: boolean = false
Optional
lastMatch
lastMatch?: T
Private
Optional
leave
leave?: ((match?) => Promise<void>)
Type declaration
-
- (match?): Promise<void>
-
Returns Promise<void>
Private
match
match: (() => Promise<undefined | null | T>)
Type declaration
-
- (): Promise<undefined | null | T>
-
Returns Promise<undefined | null | T>
Private
matching
matching: boolean = false
Private
running
running: boolean = false
Private
wait
wait: (() => Promise<void>)
Type declaration
-
- (): Promise<void>
-
Returns Promise<void>
Watches a matcher function, and trigger whenever it changes from matching to not.
Remarks
Whenever
wait
resolves, it runsmatch
, and triggersenter
with the match result, orleave
without, then wait again.By default,
wait
is a function that resolves on every page navigation or mutation.Example
Param
Context object.
Param
Options for running the watcher.