08:43 | <Jack Works> | I tried new decorator and very surprised that it does not have the semantics I expected (sorry I though it too naturally and didn't find the proposal made a different thing). |
08:45 | <Jack Works> | since native implementation is not available in Chrome, I uses TS 5.0 transpile |
08:45 | <Jack Works> | I found I cannot make an intuitive @lazy decorator |
08:46 | <Jack Works> | I received the evaluated value, but I thought it will be a () => initial_expression function so I can defer the evaluation of the field. |
08:49 | <Jack Works> | note: I know I can write @lazy x = () => expr but that's a non starter for me since TypeScript currently cannot change the type of the field. (which means T.x will have type () => X instead of X ) |
09:02 | <Jack Works> | I found some discussion in the decorator repo, basically https://github.com/tc39/proposal-decorators/issues/403
|