public IObservable <ITogglDataSource> LoginWithGoogle() => database .Clear() .SelectMany(_ => googleService.GetAuthToken()) .Select(Credentials.WithGoogleToken) .Select(apiFactory.CreateApiWith) .SelectMany(api => api.User.GetWithGoogle()) .Select(User.Clean) .SelectMany(database.User.Create) .Select(dataSourceFromUser) .Do(shortcutCreator.OnLogin);
public IObservable <ITogglDataSource> LoginWithGoogle() => database .Clear() .SelectMany(_ => googleService.LogOutIfNeeded()) .SelectMany(_ => googleService.GetAuthToken()) .SelectMany(loginWithGoogle);