Skip to content

Instantly share code, notes, and snippets.

@jonotron
Created June 25, 2013 16:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonotron/5860228 to your computer and use it in GitHub Desktop.
Save jonotron/5860228 to your computer and use it in GitHub Desktop.
IIFE to solve circular dependency issues.
// Module A
// depends on Module B
(function() {
require('./moduleB');
})();
// Module B
// depends on Module A
(function() {
require('./moduleA');
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment