@ngrx/entity

  • Version 17.2.0
  • Published
  • 352 kB
  • 1 dependency
  • MIT license

Install

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

Overview

Common utilities for entity reducers

Index

Functions

function createEntityAdapter

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

    Classes

    class Dictionary

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

      Interfaces

      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<
                  T,
                  V
                  >;
                  };

                    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)

                                      Badge

                                      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
                                        [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@ngrx/entity)
                                      • 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>