Skip to content

Commit

Permalink
Merge pull request #21 from canjs/add-global
Browse files Browse the repository at this point in the history
Document the add-global/ module
  • Loading branch information
matthewp committed Mar 21, 2018
2 parents 802e8f3 + 4d5041b commit f40b3c9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
16 changes: 16 additions & 0 deletions add-global.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@module {function} can-event-dom-enter/add-global/add-global can-event-dom-enter/add-global/add-global
@parent can-event-dom-enter
@description

Registers a global `enter` event, allowing listening to enter anywhere in your application.

@signature `unregister()`

Importing `can-event-dom-enter/add-global/add-global` registers the __enter__ event globally. Calling `unregister()` removes it from the global registry.

```js
import unregister from 'can-event-dom-enter/add-global/add-global';

// Later time
unregister();
```
1 change: 1 addition & 0 deletions can-event-dom-enter.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ function isEnterEvent (event) {
* @module {events} can-event-dom-enter
* @parent can-dom-utilities
* @collection can-infrastructure
* @group can-event-dom-enter.modules modules
* @package ./package.json
*
* Watch for when enter keys are pressed on a DomEventTarget.
Expand Down

0 comments on commit f40b3c9

Please sign in to comment.