From 97f213f7e7113a81ab71cabdd5dea7dd20a61b4f Mon Sep 17 00:00:00 2001 From: Jay Phelps Date: Tue, 19 Sep 2017 12:55:04 -0700 Subject: [PATCH] docs(effects): Remove usage of deprecated `toPayload` util in example --- docs/effects/README.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/docs/effects/README.md b/docs/effects/README.md index 68f9280271..78bf92ad54 100644 --- a/docs/effects/README.md +++ b/docs/effects/README.md @@ -46,17 +46,15 @@ import { Injectable } from '@angular/core'; import { Http } from '@angular/http'; import { Observable } from 'rxjs/Observable'; import { Action } from '@ngrx/store'; -import { Actions, Effect, toPayload } from '@ngrx/effects'; +import { Actions, Effect } from '@ngrx/effects'; import { of } from 'rxjs/observable/of'; @Injectable() export class AuthEffects { // Listen for the 'LOGIN' action @Effect() login$: Observable = this.actions$.ofType('LOGIN') - // Map the payload into JSON to use as the request body - .map(toPayload) - .mergeMap(payload => - this.http.post('/auth', payload) + .mergeMap(action => + this.http.post('/auth', action.payload) // If successful, dispatch success action with result .map(data => ({ type: 'LOGIN_SUCCESS', payload: data })) // If request fails, dispatch failed action