const widgett = {};
class Widget {
constructor() {
console.log('wi');
}
}
function Widget2() {
console.log('wi');
}
// const w = new Widget();
function logDec(factory: () => widgett):(() => widgett) {
return () => {
console.log(123);
factory();
};
}
The factory is a function that returns a Widget object, but it tells me to put a type instead of a value. But a function return a value not a type right?
FYI error message: 'widgett' refers to a value, but is being used as a type here. Did you mean 'typeof widgett'?(2749)