feat(challenge7): add read me

This commit is contained in:
thomas laforge
2022-11-27 21:18:43 +01:00
parent 2613cd9f56
commit aaeecf5f06
2 changed files with 16 additions and 4 deletions

View File

@@ -31,6 +31,7 @@ This goal of this project is to help you get better at Angular and NgRx buy reso
<img src="https://img.shields.io/badge/NgRx--gray" alt="NgRx"/> <img src="https://img.shields.io/badge/NgRx--gray" alt="NgRx"/>
<a href="./apps/ngrx-1/README.md"><img src="https://img.shields.io/badge/2-Effect vs Selector-orange" alt="Effect vs Selector"/></a> <a href="./apps/ngrx-1/README.md"><img src="https://img.shields.io/badge/2-Effect vs Selector-orange" alt="Effect vs Selector"/></a>
<a href="./apps/ngrx-notification/README.md"><img src="https://img.shields.io/badge/7-Power of Effects-red" alt="power of Effects"/></a>
## License ## License

View File

@@ -2,17 +2,28 @@
> Author: Thomas Laforge > Author: Thomas Laforge
<!-- TODO: add Information/Statement/Rules/Constraint/Steps -->
### Information ### Information
### Statement NgRx Effect is a very powerful library develop by the NgRx team. Effects subscribe to a HOT Observable and listen to any event dispatch from any place inside the application.
But what we often forget is that Effects can subscribe to ANY observables. Which means we can wrap a hot observable inside an effect and had logic in it.
In this exercice, we will find a way to create a very powerful, scalable and maintanable push messages listener. Currently, the code is located inside a single file with a if else condition to send the push data to the right location. This code is not very scalable since we need to add more and more else, and so not very maintanable since the piece of code will become bigger and bigger.
Also, we load the whole file at startup even if we haven't load some part of the application (lazy loading); and so we don't need to listen or update that part of the store. We need to decouple that logic.
### Step 1 ### Step 1
create an injection token to hide the push service implementation.
### Step 2 ### Step 2
### Constraints: create one ngrx effect, or component store effect for each push type, and implement your logic
### Step 3
load your effect only when necessary.
the application contain a root route, a lazy loaded route and a component with a local state (implemented with Component store)
### Submitting your work ### Submitting your work