Skip to content

Commit

Permalink
Refactored listenTo browser example;
Browse files Browse the repository at this point in the history
  • Loading branch information
DigitalBrainJS committed May 7, 2020
1 parent a73a487 commit f3f642f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -679,18 +679,18 @@ An example of using a wildcard emitter in a browser:
wildcard: true
});
ee.listenTo(document.querySelector('#test'), {
'click': 'div.click',
'mouseup': 'div.mouseup',
'mousedown': 'div.mousedown'
ee.listenTo(document, {
'click': 'document.click',
'mouseup': 'document.mouseup',
'mousedown': 'document.mousedown'
});
ee.on('div.*', function(evt){
ee.on('document.*', function(evt){
console.log('listenTo: '+ evt.type);
});
setTimeout(function(){
ee.stopListeningTo(document.querySelector('#test'));
ee.stopListeningTo(document);
}, 30000);
````
Expand Down

0 comments on commit f3f642f

Please sign in to comment.