Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
N

ngrx-examples

> 编程语言
Open source

@ngrx examples and resources

369 stars0 likes3 views
WebsiteGitHub

About

@ngrx examples and resources

@ngrx examples

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

Goal

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.

Contributions

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:

Introduction

  • Comprehensive Introduction to ngrx/store - Brian Troncone
  • Reactive Angular 2 with ngrx - Rob Wormald
  • @ngrx/store in 10 minutes - egghead.io - Brian Troncone

Articles

  • Build a Better Angular 2 Application with Redux and ngrx - Lukas Ruebbelke
  • Reactive Data Flow in Angular 2 - Wayne Maurer
  • Understand and Utilize the Async Pipe in Angular 2 - Brian Troncone
  • Communication Between Components & Components Design - Oren Farhi

Presentations and Slides

  • Reactive Angular 2 - NG-NL 2016 - Rob Wormald
  • Introduction to RxJS 5 - NG-NL 2016 - Gerard Sans
  • Angular 2 Change Detection Explained - Pascal Precht
  • Angular 2 and the Single Immutable State Tree - Ciro Nunes

Videos and Lessons

  • Build Redux Style Applications with Angular2, RxJS, and ngrx/store - John Linquist
  • Step-by-Step Async JavaScript with RxJS - John Lindquist
  • RxJS Lessons from Ben Lesh - Ben Lesh
  • RxJS Beyond The Basics - Creating Observables From Scratch - André Staltz
  • Introduction to Reactive Programming - André Staltz
  • Getting Started With Redux - Dan Abramov
  • Asynchronous Programming - The End of the Loop - Jafar Husain

Repositories and Code Samples

  • Official ngrx example application - Mike Ryan
  • Echo Media Player - Media Player for YouTube - Oren Fahri
  • Staffer ngrx/store example -Pavan Podila
  • Angular 2 Time Machine - John Lindquist
  • NgRx Example - Aleš
  • Todo with Undo/Redo - Rob Wormald
  • Instagram Filters - Instagram-like photo filter playground - Jay Kan

Utilities

  • ngrx-store-localstorage - Sync local storage with ngrx state slices - Brian Troncone
  • ngrx-store-logger - Advanced action/state logging for @ngrx/store applications - Brian Troncone
  • ngrx-store-freeze - Prevent state from being mutated in @ngrx/store - Attila Egyed

Getting Started

bash
# clone the repo
git clone https://github.com/btroncone/ngrx-examples.git

# cd into repo
cd ngrx-examples

# cd into project of your choice
cd counter

# install dependencies
npm install

# start the server
npm start

Build

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!).

Examples

Counter

(source)

Summary

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

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

Todos

(source)

Summary

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

Demonstrates
  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)

Summary

Same as todos example but with undo/redo functionality.

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

Async

(source)

Summary

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

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

Shopping Cart

(source)

Summary

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

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

Finances

(source) (tutorial)

Summary

Add and remove items financial operations, change currency rates

Demonstrates
  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!

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

TypeScript

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言