5

I've updated my ngrx code to version 8 (with Action Creators etc.), but I don't know now how to use Dispatcher within NgRx Store DevTools.

Before I was able to dispatch actions like this:

{
    type: '[Something] something loaded',
    payload: {
        results: ['a', 'b', 'c']
    }
}

Ngrx Store DevTools dispatcher

Sebastian Denis
  • 928
  • 10
  • 20

1 Answers1

7

In my simple app I have the following Action:

export const SaveUserInfo = createAction(
    '[User] Save user info',
    props<{ user: IUser}>()
);

and the IUser model

export interface IUser {
    name: string;
    money: number;
}

Than in DevTools I dispatch like this:

{
  user: {
    name: 'coiso',
    money: 1000
  },
  type: '[User] Save user info'
}

Hope it works for you.

Paulo Pereira
  • 211
  • 1
  • 8
  • 2
    Thanks, Paulo. I'm sure I tried this and didn't work. I have just tried again and it has worked. – Sebastian Denis Aug 12 '19 at 06:28
  • Check the browser console. Once an invalid action is diapatched it produces an exception and after that dispatch from Redux Devtools doesn't work anymore. Otherwise just copy an action from "Raw" view and copy it into the dispatch input to have working examples. – Günter Zöchbauer Jan 21 '22 at 08:01