google / ground-platform

Ground hosted components: Web console, Cloud Functions, db config

Home Page:http://groundplatform.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Code health] Clean up flow of state in SubmissionService

gino-m opened this issue · comments

  • Remove select and deselect methods and submissionId state; change submission id via NavigationService instead.
  • Use combineLatestAll to combine at active survey, selected LOI, current user and submissionId$ in NavigationService. Use distinctUntilChanged on the result of combineLatestAll to avoid hitting db multiple times.
  • Emit LOADING when any of the above changes, then loadSubmission$ - use distinctUntilChanged on return value of stream.
  • Remove unused code from MainPageComponent

@rfontanarosa

Related to Async issues with RxJs

Trying to make Beta scope tractable; let's tackle this as part of the push for GA.