checkout = (action$, store) =>
  action$.ofType(actions.CHECKOUT_REQUEST).switchMap(q => {
    const cart = getCart(store.getState());
    return api
      .buyProducts(cart)
      .map(cart => actions.checkoutSuccess(cart))
      .catch(error => Observable.of(actions.checkoutFailure(error)));
  })
checkout epic.
@param action$
@param store
@returns {any|*|Observable}