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

Requiring should provide class constructor as well as class name #38

Open
stuffaboutpete opened this issue Apr 2, 2015 · 0 comments
Open

Comments

@stuffaboutpete
Copy link
Owner

When a class is loaded inline via a call to require, the handling method currently receives the loaded class name when complete. It should also receive the class constructor considering how often this will be useful.

define(

'class MyClass',
{

    'public construct () -> undefined': function()
    {
        var className = 'SomeOtherClass';
        require(className, 'handleClassLoaded');
    },

    'private handleClassLoaded (string, function) -> undefined': function(className, classConstructor)
    {
        // We should have access to the constructor
        // in order to be able to do the following...
        var instance = new classConstructor();
        // ...
    }

});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant