# NgRx Data

* **John Papa/Ward Bell**
* **Eliminates actions, reducers, effects, selectors**
* **Entities declared in configuration**
* **Services extend EntityCollectionServiceBase using model Type**

## Installation

```bash
npm i @ngrx/data
```

## Define our data (entities)

{% embed url="https://stackblitz.com/edit/advanced-ngrx-1-ngrxdata?file=src%2Fapp%2Fentity-metadata.ts&view=editor" %}

## Declare our App Store Module

{% embed url="https://stackblitz.com/edit/advanced-ngrx-1-ngrxdata?file=src%2Fapp%2Fapp.store.module.ts&view=editor" %}

## Create Hero Service

{% embed url="https://stackblitz.com/edit/advanced-ngrx-1-ngrxdata?file=src%2Fapp%2Fcore%2Fservices%2Fhero.service.ts&view=editor" %}

## Implement in Component

{% embed url="https://stackblitz.com/edit/advanced-ngrx-1-ngrxdata?file=src%2Fapp%2Fheroes%2Fheroes.component.ts&view=editor" %}

Refactor Tour of Heroes to use NgRx-Data: [https://stackblitz.com/github/jessesanders/tour-of-heroes/tree/ngrx-data](https://stackblitz.com/github/jessesanders/tour-of-heroes/tree/container-presenter)

