Skip to content

Commit

Permalink
Clarify that there should only be one instance of AxeObserver
Browse files Browse the repository at this point in the history
  • Loading branch information
Juliette Pretot authored and jul-sh committed Nov 28, 2019
1 parent 50742bc commit d0c237d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ import('https://unpkg.com/agnostic-axe@1').then(
In the example above, once the `observe` method has been invoked, `MyAxeObserver` starts reporting accessibility defects to the browser console. It continously observes the passed node for changes. If a change has been detected, it will reanalyze the node and report any new accessibility defects.

To observe multiple nodes, one can call the `observe` method multiple times.

> Note that due to a [limitation of axe-core](https://github.com/dequelabs/axe-core/pull/1914), there should never be more than one instance of AxeObserver running in the same enviroment.
```js
MyAxeObserver.observe(root1)
MyAxeObserver.observe(root2)
MyAxeObserver.observe(root3)
```

To stop observing changes, one can call the `disconnect` method.

```js
Expand Down

0 comments on commit d0c237d

Please sign in to comment.