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

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
Copy link
Member

minrk commented Jul 31, 2017

Seems like a good solution to me.

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

gnestor commented Jul 31, 2017

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

@minrk
Copy link
Member

minrk commented Aug 1, 2017

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

@takluyver
Copy link
Member Author

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
@takluyver takluyver deleted the initialized_promise branch August 1, 2017 12:31
@gnestor gnestor mentioned this pull request Aug 3, 2017
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants