Skip to content

Conversation

@takahirox
Copy link
Collaborator

@takahirox takahirox commented Apr 5, 2018

var fnName = 'load' + type.charAt( 0 ).toUpperCase() + type.slice( 1 );
dependency = this[ fnName ]( index );

This style is a bit hard to read through the code especially for new devs because of statically unknown function reference, actually seems like some IDEs can't follow the reference (A tweet in Japanese)

So I think it'd better to expand tho lines# will increase

switch( type ) {

    case 'scene':
        dependency = this.loadScene( index );
        break;

    ....

}

Let me know if you have any better ideas.

@takahirox takahirox changed the title GLTFLoader: Clarify getDependency() GLTFLoader: Expand getDependency() Apr 5, 2018
@mrdoob
Copy link
Owner

mrdoob commented Apr 5, 2018

Much nicer!

@mrdoob mrdoob added this to the r92 milestone Apr 5, 2018
@mrdoob mrdoob merged commit 3346173 into mrdoob:dev Apr 5, 2018
@mrdoob
Copy link
Owner

mrdoob commented Apr 5, 2018

Thanks!

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.

3 participants