Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesfries committed Aug 17, 2023
1 parent 3ff42e7 commit 71ab6fa
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ configured to listen to a custom set of events from the `user-activity` service:
import UserIdleService from 'ember-user-activity/services/user-idle';

export default class UserIdle extends UserIdleService {
activeEvents = ['mousedown', 'keydown']
activeEvents = ['mousedown', 'keydown'];
}
```

Expand All @@ -184,7 +184,7 @@ export default class MyComponent extends Component {
@service('ember-user-activity@user-idle')
userIdle;

init() {
constructor() {
this.userIdle.on('idleChanged', (isIdle) => {
// isIdle is true if idle. False otherwise.
});
Expand Down Expand Up @@ -235,8 +235,10 @@ Make sure to remove any listeners before destroying their parent objects.

```javascript
// app/components/foo-bar.js
willDestroyElement() {
this.userActivity.off('keydown', this, this.keydownHandler);
export default class FooBar extends Component {
willDestroy() {
this.userActivity.off('keydown', this, this.keydownHandler);
}
}
```

Expand Down

0 comments on commit 71ab6fa

Please sign in to comment.