ngrx-vis icon indicating copy to clipboard operation
ngrx-vis copied to clipboard

Observations

Open GregOnNet opened this issue 4 years ago • 0 comments

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 avatar Mar 30 '20 07:03 GregOnNet