Minor Changes
457ea8f952f0d37681dbe4033670eea7f25a7c4d#4728 Thanks @kubk! -computed(fn)without asetoption now returnsIComputedValue<T>with onlyget(), so calling.set()on it is a type error instead of a runtime throw.computed(fn, { set })returns the newIWritableComputedValue<T>, which also hasset().
Patch Changes
-
129a01f8581d3b30d5722e7685a639541b7b929f#4743 Thanks @APX403! - FixmakeAutoObservable(this, overrides),observable(object, annotations)andextendObservablethrowing "Invalid annotation" when the object has a member that also exists onObject.prototype, such as atoString()method. Only own keys of the overrides or annotations object are used as annotations now, asmakeObservablealready does. -
01e299b9f811de46df78ddcd6f044b396ba9bd09#4738 Thanks @lavrton! -getAtomchecks 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 checkingkey in objinside 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.ObservableMapalready cleaned up its equivalenthasentries. -
ef270d16ff49e19ebd34fac5724efbaf5c4bb18d#4726 Thanks @sergioperezcheco! - FixObservableSet.delete(and thereforeclear/replace) bypassing theenforceActionsaction 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! -toJSnow includes fields declared with@observable accessor. These fields live on the prototype, so they are neither own nor enumerable properties, andtoJSreturned an object without them (often just{}). Computed values are still left out. Spread,Object.keysandJSON.stringifyare unchanged.