- TODO (WIP)
Please don't look back at 2.x, but directly head over to 3.x
EVERYTHING BELOW IS DEPRECATED
- Finally added a first version of a rudimentary, incomplete documentation
- Extended
EffectSuccess
type bypreviousInput?
andpreviousResult?
to aid in event transforms in some more complex scenarios. - Extended
SignalsFactory
type byidsMap
and extendedcreateSignalsFactory
correspondingly (see documentation). - Extended
SignalsFactory
byflattenIds
and extendedcreateSignalsFactory
correspondingly (see documentation).
- Changed definition for
TypeIdentifier
: From now on, you should always usegetIdentifier<T>()
to get your identifiers - Improved type definitions for
SignalsFactory
and types it depends on
EffectSuccess
type was missing in the index.ts- Docstring typos
- Added
completeAllSignals()
to store API, to take care of store cleanup (e.g. if the lifetime of a child store ends)
- The new convenience function
createSignalsFactory
was missing in the index.ts
- Fixed a bug for x-typed event sources with
subscribeObservableOnlyIfEventIsSubscribed
parameter: It was possible that the source was not already switched for one of the sources, when an event was already dispatched after thesubscribeObservableOnlyIfEventIsSubscribed
event was subscribed. - Removed all usage of
shareReplay
, because even withrefCount
, a case was encountered whereshareReplay
lead to a memory leak.
- Generalized and simplified the signal factories API. The factories are now monadic and naturally compose via bind (aka flatMap). See the validated-input-with-result-factory for an (admittedly complex) example.
- Changed concept for usage of parent-child stores (yes, a breaking change in a minor version, but this was not yet used by anyone). Child stores must now be created via corresponding method on the parent. Child store behaviors now always use child sources, if available, else fall back on the parent.
- Expose parent store.
- The store constructor now takes a parent store as optional parameter. If a behavior is requested from a store and it has a parent store with that behavior, than the request will be delegated to the parent. This means, all required parent behaviors should be added before being requested from a child, to avoid unexpected results. Also event sources are not delegated.
- Added also the exported low-level-type-symbols to index.ts
- Signals factories now expose their internal effect result events. Subscribing to the corresponding event streams will NOT subscribe the behaviors and thus, no effects will be triggered by simply subscribing to the streams.
- All signals factories will now pass input and result of previous calls as additional optional arguments to effects.
prepareInputWithResultSignals
andprepareValidatedInputWithResultSignals
: Added new optionwithTriggerEvent
. If set true, the result effect will only be triggered, when the corresponding event is dispatched (the event is just an alias for the invalidation event).- All signals factories now provide an event stream for unhandled effect errors. Subscribing to these streams will NOT subscribe the behaviors (thus, you can always subscribe with your generic error handler without triggering the effects unless you subscribe the behaviors of these factories).
prepareValidatedInputWithResultSignals
a custom input equals function will now also be used on the validated input (preventing a retriggered result effect upon changed input)
- Fixed module exports, to make everything available under @rx-signals/store
prepareValidatedInputSignals
Get a factory for signals representing a validated input.prepareInputWithResultSignals
Get a factory for signals representing a result for an input and result invalidation.prepareValidatedInputWithResultSignals
Get a factory for signals representing a result for a validated input.
First store utility functions This minor version brings the first utility functions to help reducing boilerplate code for standard patterns.
getIdentifier
A simple convenience function to create store type identifiers.prepareEffectSignals
A facory function that generalizes all the store setup for the case where you have an input model, an effect taking the input and producing a result model, as well as providing loading behavior and invalidation (refresh) event.
- Up to 2.2.2, the order in which events were dispatched was guaranteed only for events of the same type. Hence, in case of synchronously dispatched events A1, A2, B1, A3, B2, it was guaranteed that A2 is always received after A1, but it was not guaranteed that B1 always directly follows A2 dispatch (e.g. A1, A2, A3, B1, B2 was possible). From 2.2.3 on, there is a store-wide event queue that guarantees observers to receive events exactly in dispatch order.
- Made rxjs a peer dependency (was a dependency before) and relaxed the version requirement to ^6.4.0 (though there should be no reason not to upgrade your project to the latest 6.x version)
- Instead of passing an initial value, all corresponding methods now also accept a callback providing the initial value. This is especially useful for lazy behaviors, as you can now also perform the initial value creation lazily (of course you could already do this before, by not using initialValue, but instead piping your behavior observable with a startWith(initialValue)).
- Finally added at least some doc strings for the store API
- No longer passing undefined as initial value to
SourceObservable
, but the semantically more correctNO_VALUE
(This was not really a bug, cause passing undefined orNO_VALUE
currently made no difference at runtime. However, it might have lead to a bug in the future, when modifyingSourceObservable
without having this in mind.)
- This is the first official (non-RC) release (though documentation is still missing)
- See the git history of CHANGELOG.md, if you're interested in the changes for all the previous RC versions