> For the complete documentation index, see [llms.txt](https://briebug.gitbook.io/ngrx-workshop/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://briebug.gitbook.io/ngrx-workshop/advanced-actions/3-types-of-actions.md).

# 3 Types of Actions

* Commands
* Documents
* Events

```typescript
// Effect Action Types Example
 @Effect()
 insert: Observable<Action> = this.actions$.pipe(
   ofType<InsertUser>(UserActionTypes.InsertUser), // command
   exhaustMap(action =>
     this.service.create(action.payload.user).pipe(
       map((user: User) => new InsertUserSuccess({ result: user })), // document
       catchError(() => of(new UserActionFail(
		{ error: 'Error inserting user.' }))) // event
     )
   )
 );
```
