Simple example (ts): ```typescript interface SearchFunc { (source: string, subString: string): boolean; }
// Later let mySearch: SearchFunc; mySearch = function(source: string, subString: string) { ??? } ``` Simple example (js): ```js class MyClass = { foo() { return "foo"; } bar() { return "bar"; } } class ExtendClass extends MyClass { foo(){ ??? } bar(){ return `extended bar`; } } // Elsewhere myRunner = (classInstance) => `${classInstance.foo()} :: ${classInstance.bar()}`; myRunner(myClassInstance); myRunner(extendedClassInstance); ``` Decorations would be good for classes, but don't work for regular methods. I'm not sold we need new syntax for this -- I just find myself reaching for the `???` symbol. Especially in a typed language or in any instance that we have a class and extended paradigm, or when you have a prescribed "object" shape.
_______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss