Awesome Open Source
Awesome Open Source

@ngrx examples

Angular 2 + ngrx examples, inspired by official redux examples.


These examples illustrate how to utilize ngrx within an Angular 2 application. This repository will be actively maintained and updated as new tools and functionality become available and best practices are established.


As Angular 2 and ngrx are relatively new, patterns and best practices are still being established. Examples found in this repository demonstrate how I (or the project author) would structure the solution but discussion and refinement is always encouraged! Please open an issue, submit a pull request, or drop me a message on twitter to present a different approach or idea. This repository will feature the most solid, agreed upon techniques as they evolve.

Please add any additional Angular 2, ngrx, or reactive programming articles, repositories, or code samples you find useful. I will keep this list as up-to-date as possible!

Additional Resources

Additional Angular 2, ngrx, and reactive programming articles, repositories, and code samples:



Presentations and Slides

Videos and Lessons

Repositories and Code Samples


Getting Started

# clone the repo
git clone

# cd into repo
cd ngrx-examples

# cd into project of your choice
cd counter

# install dependencies
npm install

# start the server
npm start


Project builds are a stripped down version of Angular Class Webpack Starter, an exceptional Angular 2 seed project. Tests can be executed with either WallabyJS or Karma (soon!).





A counter which can be incremented, decremented, with the option to increment or decrement async.

  1. Creating a basic reducer
  2. Selecting a slice of state
  3. Using the async pipe
  4. Dispatching actions from a component




Basic todo application with add, remove, and toggle complete functionality.

  1. Initial reducer state
  2. Managing arrays in reducers
  3. Multiple reducers
  4. Combining data from two reducers to project state for view

Todos with Undo/Redo

(source | plunker)


Same as todos example but with undo/redo functionality.

  1. Creating a meta-reducer to add undo/redo capability.




Request and display the latest Angular or React reddit posts, utilizing the reddit API.

  1. Handling async actions with @ngrx/effects
  2. Conditionally making requests based on current state

Shopping Cart



Request sample inventory, add and remove items from shopping cart, checkout.

  1. Multiple Reducers
  2. Handling effects with @ngrx/effects
  3. Creating and applying selectors for state projection with let


(source) (tutorial)


Add and remove items financial operations, change currency rates

  1. Multiple Reducers
  2. Handling effects with @ngrx/effects
  3. Modifying state projection
  4. Using state in pipes

Real World - In Progress!

More to Come!

Related Awesome Lists
Top Programming Languages
Top Projects

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Typescript (254,498
Angular (54,879
Reactive (5,628
Reducer (3,945
Rxjs (2,770
Ngrx (1,353
Ngrx Effects (138