-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
Description
Typescript 3.9 introduced a sneaky breaking change regarding the way getter are emitted by setting enumerable: false
instead of enumerable: true
(associated PR here).
This causes extendObservable
to ignore properties defined as getters in its second parameter, like that :
const obs = extendObservable({a: 2, b: 3}, { get c() { return a + b; });
obs.c // undefined (!!)
I'm a bit surprised that no one has yet reported this, it literally broke my entire app once I upgraded.
I'm not sure how this can be mitigated : how can extendObservable
enumerate the properties to add if they aren't actually enumerable?