• Version 17.1.1
  • Published
  • 350 kB
  • 1 dependency
  • MIT license


npm i @ngrx/entity
yarn add @ngrx/entity
pnpm add @ngrx/entity


Common utilities for entity reducers



function createEntityAdapter

createEntityAdapter: <T>(options?: {
selectId?: IdSelector<T>;
sortComparer?: false | Comparer<T>;
}) => EntityAdapter<T>;


    class Dictionary

    abstract class Dictionary<T> implements DictionaryNum<T> {}


      interface DictionaryNum

      interface DictionaryNum<T> {}

        index signature

        [id: number]: T | undefined;

          interface EntityAdapter

          interface EntityAdapter<T> extends EntityStateAdapter<T> {}

            property selectId

            selectId: IdSelector<T>;

              property sortComparer

              sortComparer: false | Comparer<T>;

                method getInitialState

                getInitialState: {
                (): EntityState<T>;
                <S extends object>(state: S): EntityState<T> & S;

                  method getSelectors

                  getSelectors: {
                  (): EntitySelectors<T, EntityState<T>>;
                  <V>(selectState: (state: V) => EntityState<T>): MemoizedEntitySelectors<

                    interface EntityState

                    interface EntityState<T> {}

                      property entities

                      entities: Dictionary<T>;

                        property ids

                        ids: string[] | number[];

                          Type Aliases

                          type Comparer

                          type Comparer<T> = (a: T, b: T) => number;

                            type EntityMap

                            type EntityMap<T> = (entity: T) => T;

                              type EntityMapOne

                              type EntityMapOne<T> = EntityMapOneNum<T> | EntityMapOneStr<T>;

                                type IdSelector

                                type IdSelector<T> = IdSelectorStr<T> | IdSelectorNum<T>;

                                  type Predicate

                                  type Predicate<T> = (entity: T) => boolean;

                                    type Update

                                    type Update<T> = UpdateStr<T> | UpdateNum<T>;

                                      Package Files (3)

                                      Dependencies (1)

                                      Dev Dependencies (0)

                                      No dev dependencies.

                                      Peer Dependencies (3)


                                      To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                      You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@ngrx/entity.

                                      • Markdown
                                      • HTML
                                        <a href="https://www.jsdocs.io/package/@ngrx/entity"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>