Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: prefer using app.whenReady() #21972

Merged
merged 2 commits into from
Feb 3, 2020
Merged

refactor: prefer using app.whenReady() #21972

merged 2 commits into from
Feb 3, 2020

Conversation

ckerr
Copy link
Member

@ckerr ckerr commented Jan 30, 2020

Description of Change

In the docs, specs, and lib, replace instances of app.once('ready', ...) (seen occasionally) and app.on('ready', ...) (very common) with app.whenReady().then(...).

The goal of this small change is to encourage new users to use whenReady():

  • It handles the edge case of registering for 'ready' after it's fired
  • It avoids the minor wart of leaving an active listener alive for an event that will never fire again

Checklist

Release Notes

Notes: no-notes

In the docs, specs, and lib, replace instances of `app.once('ready')`
(seen occasionally) and `app.on('ready')` (extremely common) with
`app.whenReady()`.

It's better to encourage users to use whenReady():
1. it handles the edge case of registering for 'ready' after it's fired
2. it avoids the minor wart of leaving an active listener alive for
an event that wll never fire again
@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Jan 30, 2020
@ckerr ckerr changed the title [wip] refactor: prefer using app.whenReady() refactor: prefer using app.whenReady() Jan 30, 2020
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Jan 31, 2020
@codebytere codebytere merged commit c83f836 into master Feb 3, 2020
@release-clerk
Copy link

release-clerk bot commented Feb 3, 2020

No Release Notes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants