| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Should this mention "why" someone might want to do this? I.e. I think the relationship to decorators? Not that those are very documented, either. |
Sorry, something went wrong.
|
Ah.. Right! Perhaps simply: less boiler plate code? This is exactly what is visible in the examples. Or? |
Sorry, something went wrong.
|
Well, the immediate question with this example would be "if it generates me a getter and a setter, why not use a prop"? So I would figure that there's some other reason for them. |
Sorry, something went wrong.
A prop is not a readonly field. Of course, do I understand this isn’t a real world example. The aim is slightly different. Last week I saw the accessor keyword and I did not know what it is. Let’s read the docs, is the first thought. But there was nothing about that. |
Sorry, something went wrong.
|
On second thought, this indeed sounds mostly useful in decorators context. So leaving it for the future. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
As I was mentioning on Discord, currently the handbook does not document auto-accessors. This feature was shipped with TypeScript 4.9, but it is still in Stage 3.
To put the text together, I used these sources: