@ngrx/router-store
Advanced tools
Changelog
19.0.0-rc.0 (2024-12-10)
signalMethod
(#4597) (bdd1d3e), closes #4581withProps
base feature (#4607) (e626082)withProps
(#4612) (5f803d0), closes #4608computed
property in SignalStoreFeatureResult
type is renamed to props
.EntityComputed
and NamedEntityComputed
types in the entities
plugin are renamed to EntityProps
and NamedEntityProps
.BEFORE:
import { computed, Signal } from '@angular/core';
import { signalStoreFeature, SignalStoreFeature, type, withComputed } from '@ngrx/signals';
import { EntityComputed } from '@ngrx/signals/entities';
export function withTotalEntities<Entity>(): SignalStoreFeature<{ state: {}; computed: EntityComputed<Entity>; methods: {} }, { state: {}; computed: { total: Signal<number> }; methods: {} }> {
return signalStoreFeature(
{ computed: type<EntityComputed<Entity>>() },
withComputed(({ entities }) => ({
total: computed(() => entities().length),
}))
);
}
AFTER:
import { computed, Signal } from '@angular/core';
import { signalStoreFeature, SignalStoreFeature, type, withComputed } from '@ngrx/signals';
import { EntityProps } from '@ngrx/signals/entities';
export function withTotalEntities<Entity>(): SignalStoreFeature<{ state: {}; props: EntityProps<Entity>; methods: {} }, { state: {}; props: { total: Signal<number> }; methods: {} }> {
return signalStoreFeature(
{ props: type<EntityProps<Entity>>() },
withComputed(({ entities }) => ({
total: computed(() => entities().length),
}))
);
}
<a name="19.0.0-beta.0""></a>
Changelog
19.0.0-rc.0 (2024-12-10)
signalMethod
(#4597) (bdd1d3e), closes #4581withProps
base feature (#4607) (e626082)withProps
(#4612) (5f803d0), closes #4608computed
property in SignalStoreFeatureResult
type is renamed to props
.EntityComputed
and NamedEntityComputed
types in the entities
plugin are renamed to EntityProps
and NamedEntityProps
.BEFORE:
import { computed, Signal } from '@angular/core';
import { signalStoreFeature, SignalStoreFeature, type, withComputed } from '@ngrx/signals';
import { EntityComputed } from '@ngrx/signals/entities';
export function withTotalEntities<Entity>(): SignalStoreFeature<{ state: {}; computed: EntityComputed<Entity>; methods: {} }, { state: {}; computed: { total: Signal<number> }; methods: {} }> {
return signalStoreFeature(
{ computed: type<EntityComputed<Entity>>() },
withComputed(({ entities }) => ({
total: computed(() => entities().length),
}))
);
}
AFTER:
import { computed, Signal } from '@angular/core';
import { signalStoreFeature, SignalStoreFeature, type, withComputed } from '@ngrx/signals';
import { EntityProps } from '@ngrx/signals/entities';
export function withTotalEntities<Entity>(): SignalStoreFeature<{ state: {}; props: EntityProps<Entity>; methods: {} }, { state: {}; props: { total: Signal<number> }; methods: {} }> {
return signalStoreFeature(
{ props: type<EntityProps<Entity>>() },
withComputed(({ entities }) => ({
total: computed(() => entities().length),
}))
);
}
<a name="19.0.0-beta.0""></a>
Changelog
19.0.0-beta.0" (2024-11-20)
rxMethod.unsubscribe
to destroy
(#4584) (57ad5c5)signalState
/signalStore
state object is frozen in development mode.
If a mutable change occurs to the state object, an error will be thrown.BEFORE:
const userState = signalState(initialState);
patchState(userState, (state) => {
state.user.firstName = 'mutable change'; // mutable change which went through
return state;
});
AFTER:
const userState = signalState(initialState);
patchState(userState, (state) => {
state.user.firstName = 'mutable change'; // throws in dev mode
return state;
});
unsubscribe
method from rxMethod
is renamed to destroy
.BEFORE:
const logNumber = rxMethod<number>(tap(console.log));
const num1Ref = logNumber(interval(1_000));
const num2Ref = logNumber(interval(2_000));
// destroy `num1Ref` after 2 seconds
setTimeout(() => num1Ref.unsubscribe(), 2_000);
// destroy all reactive method refs after 5 seconds
setTimeout(() => logNumber.unsubscribe(), 5_000);
AFTER:
const logNumber = rxMethod<number>(tap(console.log));
const num1Ref = logNumber(interval(1_000));
const num2Ref = logNumber(interval(2_000));
// destroy `num1Ref` after 2 seconds
setTimeout(() => num1Ref.destroy(), 2_000);
// destroy all reactive method refs after 5 seconds
setTimeout(() => logNumber.destroy(), 5_000);
BEFORE:
The default setting for generating components using schematics does not use standalone components.
AFTER:
The default setting for generating components using schematics uses standalone components.
BEFORE:
The minimum required version is Angular 18.x
AFTER:
The minimum required version is Angular 19.x
<a name="18.1.1"></a>
Changelog
18.1.0 (2024-10-08)
Injector
of rxMethod
instance caller if available (#4529) (ffc1d87), closes #4528<a name="18.0.2"></a>
Changelog
18.0.2 (2024-07-31)
<a name="18.0.1"></a>
Changelog
18.0.1 (2024-06-27)
idKey
with selectId
when defining custom entity ID (#4396) (67a5a93), closes #4217 #4392<a name="18.0.1"></a>
Changelog
Changelog
18.0.0-rc.0 (2024-06-10)
BEFORE:
import { concatLatestFrom } from '@ngrx/effects';
AFTER:
import { concatLatestFrom } from '@ngrx/operators';
BEFORE:
import { tapResponse } from '@ngrx/component-store';
AFTER:
import { tapResponse } from '@ngrx/operators';
<a name="18.0.0-beta.1"></a>