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

Playing around with script load firing #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

jrburke
Copy link
Owner

@jrburke jrburke commented Aug 20, 2012

Doing this as a pull request to see if @lostintangent or @orand have any ideas what I am doing wrong. This pull request does not actually work, but trying to do a different approach in my effort to understand the machinery behind intellisense.

The approach I was trying to do, to allow the autocompletion in define(), was to trigger the load event after each define() call, then explicitly require the module, since by default in requirejs 2.0, define() factory functions are not called unless there is a direct require() for the define().

So I was hoping that in each call to define(), I could do a setTimeout to allow completion of the current script, then look for at the added scripts, find the one that matches a path that was recorded via requirejs.load() and if so, trigger onScriptLoad() for that script.

The trouble seems to be that the setTimeout function tracked by loadTimeId is triggered, but there are no scripts with a script src when it fires.

I guessing there is some magic that intellisense is doing, maybe I'm triggering that loadTimeId setTimeout at the wrong time.

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.

1 participant