Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Observations #3

Open
GregOnNet opened this issue Mar 30, 2020 · 0 comments
Open

Observations #3

GregOnNet opened this issue Mar 30, 2020 · 0 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@GregOnNet
Copy link
Contributor

This issue collects some graphs NgRx Vis printed out that make me having a deeper look in the code base of the respective NgRx project.

Often I really find a code or a modelling issue.

NgRx Example App

Load Books Failure

The action below is handled by an effect but has no continuation.
It is not used.

image

Load book

No dispatcher is found.
The reason is that the action is remapped in a stream and the reference is lost.
NgRx Vis cannot track the reference any more.
I don't consider this being a bug yet since remapping the action is not needed in this case

// Current
this.service.load().pipe(
  map(entity => loadBook({book: entity})),
  tap(action => store.dispatch(action))
  // ...
)

// Better
this.service.load().pipe(
  tap(entity => store.dispatch(loadBook({book: entity})))
  // ...
)

image

NgRx Facade App

Effect is calling itself

The graph below looks a bit confusing first. Having a look in the codebase, you will see that the error handling is done in a separate effect that is called by other effects.

This graph shows up multiple times for that project. This is an indicator to create an effect being responsible for error handling.

image

@GregOnNet GregOnNet added the documentation Improvements or additions to documentation label Mar 30, 2020
@GregOnNet GregOnNet self-assigned this Mar 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant