Sébastien Lucas / Dev wiki
  • Blog Wiki
  • Story book
  • Developers comics
  • Angular
    • Angular CLI + Angular.json
    • ngTemplateOutlet
    • Angular Schematic
    • Interceptor
    • Micro frontend + Mono repo
    • Build a library module
    • Error handling
    • Virtual and infinite scroll
    • Angular i18n
    • Debug Angular
    • Angular LifeCycle Hook
    • Nested forms in Angular
    • Angular Recipes
    • Master component in Angular
    • Perfomance optimization
    • Service Workers + PWA
    • Mobile
    • Electron app / Desktop app
    • Unit test & Angular
      • Unit test recipes (Jasmine / Karma / Angular)
      • Testing services with httpMock
    • Communication between components
    • Angular snippet library
    • Release and version management
    • Angular tutorial selection
    • UI components libraries
    • Angular libraries
    • Angular Tutorials
    • NGRX
      • Angular NGRX / Tips and code examples
      • Angular new Redux (alternative to ngrx)
      • NGRX unit test
      • Angular ngrx / Basics
    • Angular 2/Angular 1 differences
  • Graphql
  • Three.js
  • Ag grid
  • Open source BIM and 3D
  • Javascript
    • Null vs undefined
    • Html API
    • Await API
    • Debug memory leaks
    • Offline and PWA
    • Javascript tutorials
    • Javascript recipes
    • Bluebird missing docs
    • Alternative to lodash with ES6
    • ES6 syntax the best parts
    • Vanilla JS
  • RXJS
    • Docs
    • Recipes
    • Mock API and sandbox
    • Observables rxjs recipes
    • Combination operators
  • NODE.js
    • Environment variables
    • Fix CORS
    • Pagination requests in API
    • API tests
    • Node.js security
    • Learn node.js
    • Best libraries for node.js
    • Mongoose recipe
    • Debug node.js
  • Gatsby / React
    • Hooks
    • React concepts
    • Gatsby internationalisation
  • Ghost blog
  • Services for developers
    • SaaS images services
    • Airtable API examples
  • MISC
    • JIRA debugging
    • Wordpress plugins
    • Interview Sébastien Lucas
    • English expression
    • True recipes
    • Science podcast
  • AI
    • Machine learning open source
    • Tensor flow
    • Machine learning
    • Code examples
    • Courses and tutorials
    • Datasets
    • The Future of AI
    • Learn algo and data structures
  • Typescript
    • Generic types
    • Typescript recipes
    • Advanced types
      • Conditional types
      • Type guards
    • d.ts files
  • Docker
    • Starting with docker
    • Dockerise simple node app
    • Docker by aymen el amri
  • Mongodb
    • Pattern and data modeling
  • Devops
    • Heroku
    • Scaleway
    • Github template
    • Gitlab CI
    • http2
    • nginx
    • zsh
    • CI Continuous integration
    • DNS
    • Devops resources
    • Gcloud useful commands
    • Authenticate Gcloud
    • Documentation generators
    • Firebase database
  • Developers ressources
    • Online platform coding
      • Online courses
      • Coding games
      • Coding test platforms
      • Links to check
    • Good developers blogs
    • Nice open source project / github
  • Tooling
    • The chrome urls
    • Linux Mac tips
    • Webstorm configuration
    • Develop in Windows
    • Mac debug hardware
    • Mac Setup for a developer
    • Chrome extension
    • Develop toolbox
  • HTML / CSS
    • Tailwind
    • Css grid
    • ☘️Nice styles & generators
    • Favicon
    • Flexbox grid
    • Flexbox layout
    • PUG templates tips
    • Html and css references
    • Css snippets
    • SASS-CSS libraries
    • New things in scss
    • SASS best practices
    • Style lint
  • Tests
    • Cypress
      • Learn cypress and more tests
      • Cypress commands
      • Cypress plugins
      • Page object && app actions
      • Flaky tests
    • Mobile test
    • BDD + Cucumber
    • Puppeteer
    • Type of tests + Ressources
    • Jasmine test
    • Mock, fake, stub in unit tests
    • E2e tests with protactor
    • Mocha
  • REVIT & AEC tools
  • Git
    • Git commits
    • Git tips
    • Git hooks
    • Set up a mono repo
  • Design Pattern
    • Functional Programming
  • Job board / Remote jobs
  • SVG
  • JSON
  • Github
    • Forking a github repo
  • NPM
    • Private NPM packages
    • Publish to NPM with np
  • Yarn
    • Yarn evolution / 2, 3...
    • Yarn Linking
Powered by GitBook
On this page
  • Dispatch several actions from the same effects
  • Use of ngrx/entity
  • NGRX effects anti patterns
  • React to query success with a snackbar, confirm
  • Update ngrx version 5
  • Using ngrx entity
  • Hot and cold observable
  • Testing ngrx
  • Marble test
  • Other uses of ngrx effects
  • Filter selector in component instead of creating a new selector
  • Listening to actions dispatch in component

Was this helpful?

  1. Angular
  2. NGRX

Angular NGRX / Tips and code examples

PreviousNGRXNextAngular new Redux (alternative to ngrx)

Last updated 4 years ago

Was this helpful?

You can learn ngrx by watching the lesson of Todd Motto here. It is the most complete and linear way to learn ngrx. You should do this before diving into more precise topics.

Dispatch several actions from the same effects

Use of ngrx/entity

NGRX effects anti patterns

  • A quoted article on using effects

React to query success with a snackbar, confirm

Good tutorial that explain the refactoring of a component in ngrx

And a tutorial to put snackbar management in store

Update ngrx version 5

Using ngrx entity

Hot and cold observable

Testing ngrx

Other articles about testing ngrx

  • Official ngrx testing doc

Marble test

Other uses of ngrx effects

Article that list different use case for effects

Filter selector in component instead of creating a new selector

  getLines(): Observable<Lines[]> {
    return this.store
      .select(getProjecLines)
      .pipe(
        map(lines =>
          lines.filter(
            line => line.status === true,
          ),
        ),
      );
  }

Listening to actions dispatch in component

To prevent creating a boolean of the state of a completion in reducer. You can subscribe to the action dispatch the same way a reducer do.

showWarning() {
    return this.appActions.pipe(
      ofType(actions.ADD_LINES_SUCCESS),
      map(
        (action: actions.AddLinesSuccess) =>
          action.payload,
      ),
      takeUntil(this.onDestroy$),
      tap(({ lines }) => {

Medium article that explain the changes of ngrx v5

Medium article that explain the new feature of entity that allow to save some boiler plate code and standardize our components with entity

Not nice presentation but good example of using the adapter of ngrx entity

Alligator blog tutorial on ngrx/entity

The doc of ngrx entity adapter on github

Todd motto is a reference but is a paid resource

https://platform.ultimateangular.com/courses/ngrx-store-effects
https://stackoverflow.com/questions/41701138/dispatch-multiple-actions-in-one-effect
https://alligator.io/angular/ngrx-entity/
https://medium.com/@m3po22/stop-using-ngrx-effects-for-that-a6ccfe186399
https://bertrandg.github.io/ngrx-effects-complex-stream-with-nested-actions/
https://stackoverflow.com/questions/47554267/dispatch-multiple-action-from-one-effect
http://brianflove.com/2018/01/10/ngrx-refactor-module/
http://brianflove.com/2018/03/16/ngrx-mat-snackbar/
https://medium.com/ngrx/ngrx-5-and-schematics-2d8cc3906506
https://medium.com/ngrx/introducing-ngrx-entity-598176456e15
https://www.concretepage.com/angular-2/ngrx/ngrx-entity-example#createEntityAdapter
https://alligator.io/angular/ngrx-entity/
https://github.com/ngrx/platform/blob/master/docs/entity/adapter.md
https://medium.com/@benlesh/hot-vs-cold-observables-f8094ed53339
https://ultimateangular.teachable.com/courses/ngrx-store-effects/lectures/3923989
https://github.com/ReactiveX/rxjs/blob/master/doc/marble-testing.md
https://medium.com/@benlesh/hot-vs-cold-observables-f8094ed53339
https://github.com/ngrx/platform/blob/master/docs/store/testing.md
https://blog.angularindepth.com/start-using-ngrx-effects-for-this-e0b2bd9da165
Start using ngrx/effects for this - NgRx inDepthinDepthDev
Start using ngrx/effects for thistim_deschryver
Logo
Logo