Skip to content

Commit

Permalink
Document the add-global/ module
Browse files Browse the repository at this point in the history
This adds docs for add-global, will go into canjs/canjs.
  • Loading branch information
matthewp committed Mar 21, 2018
1 parent 802e8f3 commit 4d5041b
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 4d5041b

Please sign in to comment.