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

Variables not being conserved between modules #94

Open
mparpaillon opened this issue Aug 7, 2015 · 0 comments
Open

Variables not being conserved between modules #94

mparpaillon opened this issue Aug 7, 2015 · 0 comments

Comments

@mparpaillon
Copy link

Hello,

I'm working with a modular application where I'm using a singleton as described in the singleton pattern by Addy osmani but without the Closure since it's already handled by Browserify.

  var instance;

  function init() {  
    // Init instance
  };

  return {
    getInstance: function () {
      if ( !instance ) { // With beefy, this is always undefined
        instance = init();
      }
      return instance;
    }
  };

However, using beefy as a build tool I've encountered a significant bug; The value of the variable instance is not being conserved between require calls. I've tested the standard Browserify build and it seems to work properly.

What could be causing this behaviour ?

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

No branches or pull requests

1 participant