Socket
Socket
Sign inDemoInstall

@ngrx/component-store

Package Overview
Dependencies
Maintainers
4
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ngrx/component-store - npm Package Versions

1
8

16.0.0-rc.0

Diff

Changelog

Source

16.0.0-rc.0 (2023-05-04)

Bug Fixes

  • data: make non-optimistic add command entity partial (#3859) (93ee1db)

Features

  • component-store: add selectSignal options (503e9d8)
  • component-store: add selectSignal signature that combines provided signals (#3863) (07ba3fa)
  • store: add selectSignal options (0a13c4d)

<a name="16.0.0-beta.0"></a>

brandonroberts
published 16.0.0-beta.0 •

Changelog

Source

16.0.0-beta.0 (2023-04-27)

Bug Fixes

  • data: allow 0 to be a valid key (#3830) (e50126d), closes #3828
  • effects: run user provided effects defined as injection token (#3851) (cdaeeb6), closes #3848
  • store: correctly infer action group events defined as empty object (#3833) (dc78447)
  • store-devtools: correctly import state when feature is set to true (#3855) (0df3419), closes #3636

Features

  • component-store: add selectSignal method for interop with Angular Signals (#3861) (195d5ac)
  • component-store: add tapResponse signature with observer object (#3829) (3a5e5d8)
  • effects: accept ObservableInput as concatLatestFrom argument (#3838) (34dd28c)
  • router-store: add @nrwl/angular data persistence operators (#3841) (4482751), closes #3777
  • router-store: remove deprecated getSelectors method (#3816) (351a75e), closes #3815
  • schematics: replace any type with unknown type (#3827) (0ea2933)
  • schematics: Use createActionGroup in schematics (#3791) (f6ce20f)
  • store: add createMockStore migration (#3810) (ded4240)
  • store: add selectSignal method for interop with Angular Signals (#3856) (999dcb6)
  • store: preserve the event name case with createActionGroup (#3832) (482fa5d)
  • store: remove deprecated createFeature method (#3825) (fd8f347), closes #3814
  • store: remove forbidden chars and empty str checks from createActionGroup (#3857) (e37c57b)
  • convert entity and router selectors interfaces to types (#3853) (73eb55c)
  • store: remove getMockStore in favor of createMockStore (#3835) (8d0ed8e)
  • store: use strict projectors for createFeature selectors (#3799) (bafd121)
  • update to Angular v16.0.0-next.6 release (#3831) (d7e03df)

BREAKING CHANGES

  • store: The event name case is preserved when converting to the action name by using the createActionGroup function.

BEFORE:

All letters of the event name will be lowercase, except for the initial letters of words starting from the second word, which will be uppercase.

const authApiActions = createActionGroup({
  source: 'Auth API',
  events: {
    'LogIn Success': emptyProps(),
    'login failure': emptyProps(),
    'Logout Success': emptyProps(),
    logoutFailure: emptyProps(),
  },
});

// generated actions:
const { loginSuccess, loginFailure, logoutSuccess, logoutfailure } = authApiActions;

AFTER:

The initial letter of the first word of the event name will be lowercase, and the initial letters of the other words will be uppercase. The case of other letters in the event name will remain the same.

const { logInSuccess, loginFailure, logoutSuccess, logoutFailure } = authApiActions;
  • store: The createFeature signature with root state is removed in favor of a signature without root state. An automatic migration is added to remove this signature.

BEFORE:

interface AppState {
  users: State;
}

export const usersFeature = createFeature<AppState>({
  name: 'users',
  reducer: createReducer(initialState /* case reducers */),
});

AFTER:

export const usersFeature = createFeature({
  name: 'users',
  reducer: createReducer(initialState /* case reducers */),
});
  • router-store: The deprecated getSelectors function has been removed from the @ngrx/router-store package.

BEFORE:

The @ngrx/router-store package exports the getSelectors function.

AFTER:

The @ngrx/router-store package no longer exports the getSelectors function. A migration has been provided to replace existing usage

  • schematics: NgRx Schematics do not use any types to define actions, these are replaced with the unknown type.

BEFORE:

Schematics used the any type to declare action payload type.

AFTER:

Schematics use the unknown type to declare action payload type.

  • store: The getMockStore function is removed in favor of createMockStore

BEFORE:

import { getMockStore } from '@ngrx/store/testing';
const mockStore = getMockStore();

AFTER:

import { createMockStore } from '@ngrx/store/testing';
const mockStore = createMockStore();
  • store: Projectors of selectors generated by createFeature are strongly typed.

BEFORE:

Projector function arguments of selectors generated by createFeature are not strongly typed:

const counterFeature = createFeature({
  name: 'counter',
  reducer: createReducer({ count: 0 }),
});

counterFeature.selectCount.projector;
// type: (...args: any[]) => number

AFTER:

Projector function arguments of selectors generated by createFeature are strongly typed:

const counterFeature = createFeature({
  name: 'counter',
  reducer: createReducer({ count: 0 }),
});

counterFeature.selectCount.projector;
// type: (featureState: { count: number; }) => number

<a name="15.4.0"></a>

brandonroberts
published 15.4.0 •

Changelog

Source

15.4.0 (2023-03-16)

Bug Fixes

Features

<a name="15.3.0"></a>

brandonroberts
published 15.3.0 •

Changelog

Source

15.3.0 (2023-02-13)

Bug Fixes

  • store: support using factory selectors as extra selectors (#3767) (f4714c3)

Features

<a name="15.2.1"></a>

brandonroberts
published 15.2.1 •

Changelog

Source

15.2.1 (2023-01-26)

<a name="15.2.0"></a>

brandonroberts
published 15.2.0 •

Changelog

Source

15.2.0 (2023-01-26)

Features

<a name="15.1.0"></a>

brandonroberts
published 14.3.3 •

brandonroberts
published 15.1.0 •

Changelog

Source

15.1.0 (2022-12-21)

Bug Fixes

  • component-store: revert throwError usages with factory for RxJS 6 compatibility (726dfb7)
  • data: revert throwError usages with factory for RxJS 6 compatibility (a137b59), closes #3702
  • eslint-plugin: remove @angular-devkit/schematics dependency (#3710) (f0ae915), closes #3709
  • schematics: disable package json peer dep updates during build (#3692) (9cfc103), closes #3691
  • store: support using createActionGroup with props typed as unions (#3713) (e75fa1a), closes #3712

Features

<a name="15.0.0"></a>

brandonroberts
published 15.0.0 •

Changelog

Source

15.0.0 (2022-11-29)

Features

<a name="15.0.0-rc.0"></a>

brandonroberts
published 15.0.0-rc.0 •

Changelog

Source

15.0.0-rc.0 (2022-11-23)

Features

  • component: clear LetDirective view when replaced observable is in suspense state (#3671) (ec59c4b)
  • component: remove $ prefix from LetViewContext property names (#3670) (b3b21e6)

BREAKING CHANGES

  • component: The LetDirective view will be cleared when the replaced observable is in a suspense state. Also, the suspense property is removed from the LetViewContext because it would always be false when the LetDirective view is rendered. Instead of suspense property, use the suspense template to handle the suspense state.

BEFORE:

The LetDirective view will not be cleared when the replaced observable is in a suspense state and the suspense template is not passed:

@Component({
  template: `
    <!-- When button is clicked, the 'LetDirective' view won't be cleared. -->
    <!-- Instead, the value of 'o' will be 'undefined' until the replaced -->
    <!-- observable emits the first value (after 1 second). -->
    <p *ngrxLet="obs$ as o">{{ o }}</p>
    <button (click)="replaceObs()">Replace Observable</button>
  `,
})
export class TestComponent {
  obs$ = of(1);

  replaceObs(): void {
    this.obs$ = of(2).pipe(delay(1000));
  }
}

AFTER:

The LetDirective view will be cleared when the replaced observable is in a suspense state and the suspense template is not passed:

@Component({
  template: `
    <!-- When button is clicked, the 'LetDirective' view will be cleared. -->
    <!-- The view will be created again when the replaced observable -->
    <!-- emits the first value (after 1 second). -->
    <p *ngrxLet="obs$ as o">{{ o }}</p>
    <button (click)="replaceObs()">Replace Observable</button>
  `,
})
export class TestComponent {
  obs$ = of(1);

  replaceObs(): void {
    this.obs$ = of(2).pipe(delay(1000));
  }
}
  • component: The $ prefix is removed from LetViewContext property names.

BEFORE:

<ng-container *ngrxLet="obs$; $error as e; $complete as c"> ... </ng-container>

AFTER:

<ng-container *ngrxLet="obs$; error as e; complete as c"> ... </ng-container>

<a name="15.0.0-beta.1"></a>

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc