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

Projects
None yet
3 participants
@takluyver
Member

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

This comment has been minimized.

Show comment
Hide comment
@minrk

minrk Jul 31, 2017

Member

Seems like a good solution to me.

Member

minrk commented Jul 31, 2017

Seems like a good solution to me.

@gnestor gnestor referenced this pull request Jul 31, 2017

Closed

Release 5.1 #2708

11 of 11 tasks complete
@gnestor

This comment has been minimized.

Show comment
Hide comment
@gnestor

gnestor Jul 31, 2017

Contributor

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

Contributor

gnestor commented Jul 31, 2017

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

@minrk

This comment has been minimized.

Show comment
Hide comment
@minrk

minrk Aug 1, 2017

Member

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

Member

minrk commented Aug 1, 2017

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

@minrk

minrk approved these changes Aug 1, 2017

@takluyver

This comment has been minimized.

Show comment
Hide comment
@takluyver

takluyver Aug 1, 2017

Member

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

Member

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

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 referenced this pull request Aug 3, 2017

Merged

Add 5.1.0 to changelog #2723

@plgorski plgorski referenced this pull request Jul 6, 2018

Open

Jupyter 5 update #7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment