Closed LFF5644 closed 3 weeks ago
Because declare return type of changeTitle()
is string
What string is it returning? What is the meaning of the returned string?
It should return new title string , but not implemeted yet ....
else {
// const tt = getTitle(handle)
return ''
}
What would be the point of returning the value of a setter? I think setters should always return nothing or maybe success/failure if applicable. Or are you referencing something?
The new title may not equal to the input value completely, due to length, case or some thing others. Then developer can validate action result strictly, not only title write.
I see. If it was my library, I would offer a getTitle
but its not, go for it. :sweat_smile:
https://github.com/waitingsong/node-win32-api/blob/22239e83db6f3725ce95677f3f23ae25a1991899/packages/win32-api/demo/create_window.ts#L165-L165 way you use
return '';
you can also usereturn;