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
waitresolves, it runsmatch, and triggersenterwith the match result, orleavewithout, then wait again.By default,
waitis a function that resolves on every page navigation or mutation.Example
Param
Context object.
Param
Options for running the watcher.