Sawtaytoes
9/30/2018 - 3:55 AM

Side-Effects

Use Redux-Observable to start a logging service after receiving user info.

const startLoggingServiceEpic = (
  action$,
) => (
  action$
  .pipe(
    ofType(UPDATE_USER_INFO),
    map(({
      email,
      phone,
      userName,
    }) => ({
      emailAddress: email,
      phoneNumber: phone,
      userName,
    })),
    tap(updateLoggingService),
    ignoreElements(),
  )
)