Skip to content

Commit

Permalink
Clear cache on disconnect
Browse files Browse the repository at this point in the history
Signed-off-by: J Pretot <j@jul.sh>
  • Loading branch information
Juliette Pretot authored and jul-sh committed Feb 26, 2020
1 parent 4c4b48d commit e717048
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ MyAxeObserver.observe(document.getElementById('vue-header'))
MyAxeObserver.observe(document.getElementById('page-footer'))
```

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

```js
MyAxeObserver.disconnect()
Expand Down
1 change: 1 addition & 0 deletions src/AxeObserver.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export default class AxeObserver {
}
disconnect() {
this._mutationObserver.disconnect()
this.__alreadyReportedIncidents.clear()
}
async _auditNode(node) {
const response = await this._auditQueue.run(async () => {
Expand Down

0 comments on commit e717048

Please sign in to comment.