Skip to content

Commit e717048

Browse files
Juliette Pretotjul-sh
Juliette Pretot
authored andcommitted
Clear cache on disconnect
Signed-off-by: J Pretot <j@jul.sh>
1 parent 4c4b48d commit e717048

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

README.MD

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ MyAxeObserver.observe(document.getElementById('vue-header'))
4141
MyAxeObserver.observe(document.getElementById('page-footer'))
4242
```
4343

44-
To stop observing changes, invoke the `disconnect` method.
44+
To stop observing changes, invoke the `disconnect` method. This also clears the cache of violations that were already reported.
4545

4646
```js
4747
MyAxeObserver.disconnect()

src/AxeObserver.mjs

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ export default class AxeObserver {
6060
}
6161
disconnect() {
6262
this._mutationObserver.disconnect()
63+
this.__alreadyReportedIncidents.clear()
6364
}
6465
async _auditNode(node) {
6566
const response = await this._auditQueue.run(async () => {

0 commit comments

Comments
 (0)