Releases: soxtoby/event-reduce
Releases · soxtoby/event-reduce
v0.7.4
v0.7.3
v0.7.2
v0.7.1
- Support for new decorator syntax (in addition to legacy syntax).
@reducedon auto-accessor properties and getters.@derivedon getters.@stateon fields, auto-accessor properties, and getters.@state('param')on classes, for marking constructor properties as state.@modeland@eventson classes.
@modelis required on class when new@reduced,@derived, or@statedecorators are used.
v0.7.0
- Improved performance and memory usage.
- Disabled expensive validation in production.
- Fixed rendering in React strict mode.
Derivation.unsubscribeFromSourcesno longer clears list of sources.useModel,useDerived, anduseReducedno longer dispose their value on "unmount".- Removed
notifyObserversparameter fromObservableValue.setValue. - Support for
@reduceddecorator on getter properties. - Events returned from getters in
@eventsclasses are memoized. - Fixed disposing mutable models.
v0.6.0
- New derivation invalidation logic ensures that derivations always get the latest values from their sources.
IObservableValue<T>once again implementsIObservable<T>, andvaluesproperty has been removed.- Replaced
PromiseQueuewithMicrotaskQueue. - Derivations take in an optional
valuesEqualfunction to determine if the values have changed. - Added optional dependencies parameter to
useModel()to allow the model to be recreated when the dependencies change. - Events and event classes will produce errors if used directly as state. They can still be part of models that are in state.
- Removed the deprecated
readonlyproperty on mutable models.
Logging improvements
- Improved logging performance.
- Improved logging for react components.
- Fixed a memory leak where all sources were being held onto by logs.
- All logs are collapsed by default.
- Built-in "restored" event is not logged as a source for reductions.
v0.5.0
IObservables are nowDisposable. The[Symbol.dispose]method cleans up both sources and observers.ObservableValues can have multiple "owners", and are disposed once removed from every owner.- Improved type definitions for
State<T>andScoped<T, Scope>. Subjecttakes in agetDisplayNameparameter, similar to other observables.- Added
IObservable.filterMap(), which allows selecting something from inside an event, and only passing it along if it was found. - Derivations log the source that invalidated them when they re-calculate.
useDerivedre-calculates every render unless external dependencies are specified and haven't changed.- Derived props in model proxies are now calculated correctly when a source prop has been overridden on the proxy.
- Better logging for React elements by
reactiveanduseReactive. - Performance improvements for disposing models and serializing state.
Breaking changes
IEventandIAsyncEventreturn the value that was passed into them.- Derivations no longer re-calculate immediately when a dependency changes. Instead, they're invalidated, and re-calculated on next access.
IObservableValue<T>now implementsIObservable<void>and fires when the value is invalidated. To subscribe to changes of the actual value, use thevaluesproperty.- Removed
watchandIWatchernow that derivations can be subscribed to without the value being re-calculated. matchesScoperequires thatscopeis anobject, similar toIEvent.scope.Subjectno longer allows different "in" and "out" types.- Triggering an event in a derivation is now an error.
reactivecomponent props are no longer observable. Use theuseObservedPropshook instead if neccessary.reactiveis now just a thin wrapper arounduseReactive, and no longer appliesmemoorforwardRefto the component.