You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
Minor Changes
457ea8f952f0d37681dbe4033670eea7f25a7c4d#4728 Thanks @kubk! - computed(fn) without a set option now returns IComputedValue<T> with only get(), so calling .set() on it is a type error instead of a runtime throw. computed(fn, { set }) returns the new IWritableComputedValue<T>, which also has set().
Patch Changes
129a01f8581d3b30d5722e7685a639541b7b929f#4743 Thanks @APX403! - Fix makeAutoObservable(this, overrides), observable(object, annotations) and extendObservable throwing "Invalid annotation" when the object has a member that also exists on Object.prototype, such as a toString() method. Only own keys of the overrides or annotations object are used as annotations now, as makeObservable already does.
01e299b9f811de46df78ddcd6f044b396ba9bd09#4738 Thanks @lavrton! - getAtom checks for observable objects first: it is faster on them and no longer subscribes the running derivation to the internal set/map marker keys.
51c51658ce63895d40dc60a5e0eb0d5b7ac5ec2c#4723 Thanks @giaBaoJS! - Release the internal key subscriptions of observable objects once they are no longer observed. Reading a missing property or checking key in obj inside a reaction created an entry that was kept for the lifetime of the object, so objects used as dynamic dictionaries grew with every key ever looked up. ObservableMap already cleaned up its equivalent has entries.
ef270d16ff49e19ebd34fac5724efbaf5c4bb18d#4726 Thanks @sergioperezcheco! - Fix ObservableSet.delete (and therefore clear/replace) bypassing the enforceActions action diagnostics. Deleting observed values outside an action now warns/throws just like insertion already does, instead of silently allowing the mutation.
c71198629959cacbfa3582a72a43dc51294360cb#4741 Thanks @Om-singhaI! - toJS now includes fields declared with @observable accessor. These fields live on the prototype, so they are neither own nor enumerable properties, and toJS returned an object without them (often just {}). Computed values are still left out. Spread, Object.keys and JSON.stringify are unchanged.