Skip to main content

Interface: SubscribeValueWrapper<T>

SubscribeValueWrapper is the standard structure for values emitted by our observables.

It wraps both the new and old values associated with a state change. Both properties are optional, which is useful during initialization when an old value might not exist.

Remarks​

This wrapper ensures consistency across observable emissions so that subscribers always have access to both the current and previous values.

Example​

observable.subscribe(({ newValue, oldValue }) => {
console.log('State update:', { newValue, oldValue });
});

Type Parameters​

T​

T

Properties​

newValue?​

optional newValue?: Nullable<T>

The updated value after the change.


oldValue?​

optional oldValue?: Nullable<T>

The previous value before the change.