-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
DuplicateAn existing issue was already createdAn existing issue was already createdNeeds ProposalThis issue needs a plan that clarifies the finer details of how it could be implemented.This issue needs a plan that clarifies the finer details of how it could be implemented.SuggestionAn idea for TypeScriptAn idea for TypeScript
Description
The early discussions about generics had this feature outlined, but it never made it into the final version for some reason. Meanwhile, it would be extremely helpful in some cases. The use case that it most dear to my heart is Knockout:
interface Observable<T> {
<U>( this: U, value: T ): U;
}
var viewModel = {
Str: ko.observable( "abc" ),
Num: ko.observable( 5 )
};
viewModel.Str( "xyz" ).Num( 10 );
Metadata
Metadata
Assignees
Labels
DuplicateAn existing issue was already createdAn existing issue was already createdNeeds ProposalThis issue needs a plan that clarifies the finer details of how it could be implemented.This issue needs a plan that clarifies the finer details of how it could be implemented.SuggestionAn idea for TypeScriptAn idea for TypeScript