ngneat / effects

🪄 A framework-agnostic RxJS effects implementation
https://www.netbasal.com
MIT License
63 stars 11 forks source link

No DevTools action reporting with Angular + effects-ng #26

Closed przemyslawpedziwiatr closed 2 years ago

przemyslawpedziwiatr commented 2 years ago

Which @ngneat/effects-* package(s) are the source of the bug?

effects-ng

Is this a regression?

No

Description

Following the Akita documentation of effects (https://opensource.salesforce.com/akita/docs/angular/effects) I tried to integrate this library into my project. It all went flawlessly, however the dispatched actions does not show up in the Redux DevTools, which is actually very useful.

It works however with @datorama/akita-ng-effects, the actions show up every time they're dispatched.

I have pretty much followed the README, declaring:

The actions:

export const fooAction = actionsFactory('foo');
export const loadFooDetails = fooAction.create('Load Foo Details');

Then the effects injectable:

@Injectable({ providedIn: 'root' })
export class FooEffects {
// ...
  loadFoo$ = createEffect((actions) =>
    actions.pipe(
      ofType(loadGeoPlannerDetails),
      switchMap(() => this.performFetch()),
  );
}

Later dispatched with:

this.actions.dispatch(loadGeoPlannerDetails());

Of course importing the effects module:

imports: [ 
 ...,
 EffectsNgModule.forFeature([FooEffects]) ]
]

Pretty much the most basic stuff - it works, fetch is being launched, data in store changed, but it does not show up in the dev tools. For the moment I just have to resort back to Akita's deprecated implementation as it really makes it easier to develop with dev tools.

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

No response

Please provide the environment you discovered this bug in

Angular 13, Redux Dev Tools 3.0.11

Anything else?

No response

Do you want to create a pull request?

No

NetanelBasal commented 2 years ago

Yes, it works with Elf devtools, but not with Akita. You have two options:

  1. Migrate to Elf
  2. Use @datorama/akita-ng-effects
kiesman99 commented 2 years ago

Hey @przemyslawpedziwiatr there is a new section in the Documentation which should give you an idea how to include the actions of @ngneat/effects into the devtools.

Hope this helps!