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

Add a promise for app_initialized event. #2710

Merged
merged 2 commits into from Aug 1, 2017

Conversation

@takluyver
Copy link
Member

@takluyver takluyver commented Jul 31, 2017

See gh-2499

The idea is that custom.js code which was previously listening for app_initialized.NotebookApp events can do this instead:

define([
        'base/js/namespace',
        'base/js/promises'
     ], function(Jupyter, promises) {
         promises.app_initialized.then(function(appname) {
             if (appname === 'NotebookApp') {
                 do_stuff()
             }
         });
     });

I've milestoned this for 5.1 so that we consider it, as I think this is the answer to a long-running annoyance with the event firing before the code listens for it. But I don't mind if we decide to push it back to a later release.

@minrk
minrk approved these changes Jul 31, 2017
@minrk
Copy link
Member

@minrk minrk commented Jul 31, 2017

Seems like a good solution to me.

@gnestor gnestor mentioned this pull request Jul 31, 2017
11 of 11 tasks complete
@gnestor
Copy link
Contributor

@gnestor gnestor commented Jul 31, 2017

Looks good to me. Should we update the custom.js docs?

@minrk
Copy link
Member

@minrk minrk commented Aug 1, 2017

@gnestor good call. I pushed an update to custom.js

@minrk
minrk approved these changes Aug 1, 2017
@takluyver
Copy link
Member Author

@takluyver takluyver commented Aug 1, 2017

Thanks - I was just about to look at it, so you saved me a few minutes. :-)

@takluyver takluyver merged commit 9f5926e into jupyter:master Aug 1, 2017
4 checks passed
4 checks passed
codecov/patch Coverage not affected when comparing decb30d...1812469
Details
codecov/project 79.73% (-0.03%) compared to decb30d
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@takluyver takluyver deleted the takluyver:initialized_promise branch Aug 1, 2017
@gnestor gnestor mentioned this pull request Aug 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.