Closed justinfagnani closed 6 years ago
I'm doing a scrub of these bugs. Happy to say that this is still supported in the current version! You can actually use a private field for the underlying storage, so it doesn't pollute the object and all writes are really intercepted.
@littledan asked me for some use cases, so here's my current top use case:
Decorators that replace a class field with a getter/setter pair and auxiliary storage are a great way to implement pre-property change observation. The decorator I use in TypeScript is similar to this:
This decorator demonstrates wrapping an existing member, and adding a new private-ish one to the class.