@ngrx/component-store
Advanced tools
Changelog
15.0.0-beta.1 (2022-11-18)
title: string | undefined
is added to the MinimalActivatedRouteSnapshot
interface.BEFORE:
The MinimalActivatedRouteSnapshot
interface doesn't contain the title
property.
AFTER:
The MinimalActivatedRouteSnapshot
interface contains the required title
property.
<a name="15.0.0-beta.0"></a>
Changelog
15.0.0-beta.0 (2022-11-03)
select
(#3629) (f8d0241), closes #3632 #3631ReactiveComponentModule
is removed in favor of LetModule
and PushModule
.BEFORE:
import { ReactiveComponentModule } from '@ngrx/component';
@NgModule({
imports: [
// ... other imports
ReactiveComponentModule,
],
})
export class MyFeatureModule {}
AFTER:
import { LetModule, PushModule } from '@ngrx/component';
@NgModule({
imports: [
// ... other imports
LetModule,
PushModule,
],
})
export class MyFeatureModule {}
BEFORE:
You could pass any arguments to the projector method
const selector = createSelector( selectString, // returning a string selectNumber, // returning a number (s, n, prefix: string) => { return prefix + s.repeat(n); } )
// you could pass any argument selector.projector(1, 'a', true);
AFTER:
const selector = createSelector( selectString, // returning a string selectNumber, // returning a number (s, n, prefix: string) => { return prefix + s.repeat(n); } )
// this throws selector.projector(1, 'a', true); // this does not throw because the arguments have the correct type selector.projector(1, 'a', 'prefix');
BEFORE:
The projector is not type-safe by default, allowing for potential mismatch types in the projector function.
const mySelector = createSelector(
() => 'one',
() => 2,
(one, two) => 3
);
mySelector.projector(); // <- type is projector(...args: any[]): number
AFTER:
The projector is strict by default, but can be bypassed with an any
generic parameter.
const mySelector = createSelector(
() => 'one',
() => 2,
(one, two) => 3
);
mySelector.projector(); // <- Results in type error. Type is projector(s1: string, s2: number): number
To retain previous behavior
const mySelector = createSelector(
() => 'one',
() => 2,
(one, two) => 3
)(mySelector.projector as any)();
BEFORE:
Defining an effect is done with @Effect
@Effect() data$ = this.actions$.pipe();
AFTER:
Defining an effect is done with createEffect
data$ = createEffect(() => this.actions$.pipe());
provideEffects
is changed to expect a
spreaded array of effects.BEFORE:
provideEffects
expecteded the effects to be passed as an array.
// single effect
provideEffects([MyEffect]);
// multiple effects
provideEffects([MyEffect, MySecondEffect]);
AFTER:
provideEffects
expects the effects as a spreaded array as argument.
// single effect
provideEffects(MyEffect);
// multiple effects
provideEffects(MyEffect, MySecondEffect);
<a name="14.3.2"></a>
Changelog
14.3.2 (2022-10-04)
<a name="14.3.1"></a>
Changelog
14.3.0 (2022-08-25)
<a name="14.2.0"></a>
Changelog
14.1.0 (2022-08-09)
<a name="14.0.2"></a>
Changelog
14.0.2 (2022-07-12)
<a name="14.0.1"></a>
Changelog
14.0.1 (2022-06-29)
<a name="14.0.0"></a>