コード例 #1
0
 public MarkWorkspacesAsInaccessibleParams(
     IEnumerable <IThreadSafeWorkspace> Workspaces,
     IFetchObservables FetchObservables)
 {
     this.Workspaces       = Workspaces;
     this.FetchObservables = FetchObservables;
 }
コード例 #2
0
 public IObservable <ITransition> Start(IFetchObservables fetch)
 => fetch.GetSingle <TInterface>()
 .SingleAsync()
 .SelectMany(entity => entity == null
             ? Observable.Return(Unit.Default)
             : dataSource.UpdateWithConflictResolution(convertToThreadsafeEntity(entity)).Select(_ => Unit.Default))
 .Select(_ => FinishedPersisting.Transition(fetch));
コード例 #3
0
 public IObservable <ITransition> Start(IFetchObservables fetch)
 => fetch.GetList <TInterface>()
 .SingleAsync()
 .Select(toThreadsafeList)
 .SelectMany(dataSource.BatchUpdate)
 .Select(_ => FinishedPersisting.Transition(fetch))
 .OnErrorReturnResult(ErrorOccured);
コード例 #4
0
 public IObservable <ITransition> Start(IFetchObservables fetch)
 => fetch.GetList <ITimeEntry>()
 .SingleAsync()
 .SelectMany(Identity)
 .Distinct(timeEntry => timeEntry.ProjectId)
 .WhereAsync(hasUnknownProject)
 .SelectMany(createProjectPlaceholder)
 .Count()
 .Track(analyticsService.ProjectPlaceholdersCreated)
 .SelectValue(Done.Transition(fetch));
コード例 #5
0
 public IObservable <ITransition> Start(IFetchObservables fetch)
 => fetch.GetList <ITimeEntry>()
 .SingleAsync()
 .SelectMany(Identity)
 .Distinct(timeEntry => timeEntry.ProjectId)
 .WhereAsync(needsGhostProject)
 .SelectMany(createGhostProject)
 .Count()
 .Track(analyticsService.ProjectGhostsCreated)
 .Select(FinishedPersisting.Transition(fetch));
コード例 #6
0
 public IObservable <ITransition> Start(IFetchObservables fetch)
 => fetch.GetList <T>()
 .Do(maybeUpdateSinceDates)
 .SelectValue(Done.Transition(fetch));
コード例 #7
0
 public IObservable <ITransition> Start(IFetchObservables fetch)
 => getProjectsWhichNeedsRefetching()
 .SelectMany(projects => projects == null
             ? Observable.Return(FinishedPersisting.Transition(fetch))
             : refetch(projects).Select(FetchNext.Transition(fetch)))
 .OnErrorReturnResult(ErrorOccured);
コード例 #8
0
ファイル: PersistListState.cs プロジェクト: l0gaw/mobileapp
 public IObservable <ITransition> Start(IFetchObservables fetch)
 => fetch.GetList <TInterface>()
 .SingleAsync()
 .Select(toThreadsafeList)
 .SelectMany(dataSource.BatchUpdate)
 .Select(_ => Done.Transition(fetch));
コード例 #9
0
 protected abstract IObservable <T> FetchObservable(IFetchObservables fetch);
コード例 #10
0
 public IObservable <ITransition> Start(IFetchObservables fetchObservables)
 => FetchObservable(fetchObservables)
 .SingleAsync()
 .Select(_ => Done.Transition(fetchObservables))
 .OnErrorReturnResult(ErrorOccured);
コード例 #11
0
 public IObservable <ITransition> Start(IFetchObservables fetch)
 => fetch.GetList <TInterface>()
 .Do(maybeUpdateSinceDates)
 .Select(Finished.Transition(fetch));
コード例 #12
0
 protected override IObservable <T> FetchObservable(IFetchObservables fetch)
 => fetch.GetSingle <T>();
コード例 #13
0
 public IObservable <ITransition> Start(IFetchObservables fetch)
 => internalState.Start(fetch)
 .SelectMany(_ => fetch.GetList <TInterface>()
             .Do(maybeUpdateSinceDates)
             .Select(__ => FinishedPersisting.Transition(fetch)));
 private IObservable <ITransition> handlePresenceOfWorkspaces(IFetchObservables fetch)
 => internalState.Start(fetch)
 .Select(FinishedPersisting.Transition(fetch));
 public IObservable <ITransition> Start(IFetchObservables fetch)
 => fetch.GetList <IWorkspace>()
 .SelectMany(workspaces => workspaces.Any()
             ? handlePresenceOfWorkspaces(fetch)
             : Observable.Throw <ITransition>(new NoWorkspaceException()));
コード例 #16
0
 protected override IObservable <IList <T> > FetchObservable(IFetchObservables fetch)
 => fetch.GetList <T>();
コード例 #17
0
 public IObservable <ITransition> Start(IFetchObservables fetch)
 => UnsafeState.Start(fetch)
 .Catch((Exception exception) => processError(exception));
コード例 #18
0
 public IObservable <ITransition> Start(IFetchObservables fetch)
 => fetch.GetList <ITimeEntry>()
 .SingleAsync()
 .SelectMany(Identity)
 .WhereAsync(hasUnknownDependency)
 .SelectMany(timeEntry =>