You are responsible to load your code by requiring the different modules you application is composed of.
Depending on the architecture and the complexity of your application, you can organize your code in subsystems. Even in this case, though, you are responsible to define when a subsystem is considered to be fully loaded and initialized.
--
Total Node newb here. :) I just started a few weeks ago and have been learning it. I am curious if there is an equivalent to a window.onload event handler in NodeJS. Essentially, I am looking to execute a delegate when all of the code in my NodeJS application has loaded.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/eda70092-dd72-4827-ba2c-af87b8d8b6ab%40googlegroups.com.
My problem had to do with how I was packaging my code for my Node.js application. Essentially, I was creating a single "application.js" file, but the contents would be:<entry.js><dependency.js>entry.js was referencing elements in dependency.js, but since dependency.js was being emitted *after* entry.js, I was getting a ReferenceError at runtime. By putting my entry.js in a setTimeout (with 0ms), I was able to work around this problem. setTimeout has always seemed like a hack to me, so I try to avoid it at all costs, but here it seems like a good use of it.
--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to a topic in the Google Groups "nodejs" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/nodejs/DFzVn3YBbM0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to nodejs+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/010C8A32-ABA9-4BDF-AA3D-DF9DCE2B4EC6%40g8o.net.