Skip to content

Commit 6fe89c5

Browse files
committed
Commented on why having chosen *any* instead of *Function* for ICommand implementor classes
1 parent e6c905c commit 6fe89c5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/org/puremvc/typescript/multicore/core/Controller.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,15 @@ module puremvc
115115
*/
116116
executeCommand( notification:INotification ):void
117117
{
118-
//TODO Identify if here *any* is the right choice instead of Function ( won't compile if set to Function because it is not newable on new commandClassRef )
118+
/*
119+
* Typed any here instead of <code>Function</code> ( won't compile if set to Function
120+
* because today the compiler consider that <code>Function</code> is not newable and
121+
* doesn't have a <code>Class</code> type)
122+
*/
119123
var commandClassRef:any = this.commandMap[ notification.getName() ];
120124
if( commandClassRef )
121125
{
122-
var command:ICommand = new commandClassRef();
126+
var command:ICommand = <ICommand> /*</>*/ new commandClassRef();
123127
command.initializeNotifier( this.multitonKey );
124128
command.execute( notification );
125129
}

0 commit comments

Comments
 (0)