1. 06 Sep, 2019 3 commits
    • MozLando's avatar
      Merge #4327 · b2f19348
      MozLando authored
      
      
      4327: Flow.ifChanged(): Added variant that takes a mapping function. r=csadilek a=pocmo
      
      This pattern emerged while migrating components. Often I want listen to value changes, but if the value changes then I need more than only the changed value.
      
      One example is the downloads feature. I want to listen to download changes. But if that changes then I need the whole `SessionState` object.
      
      Previously:
      
      ```kotlin
      scope = store.flowScoped { flow ->
          flow.mapNotNull { state -> state.findCustomTabOrSelectedTab(customTabId) }
                 .map { it.content.download }
                 .ifChanged()
                .collect { download ->
                    // Okay, the DownloadState object now. But I also want the enclosing SessionState.
                }
      }
      ```
      
      Now:
      
      ```kotlin
      scope = store.flowScoped { flow ->
          flow.mapNotNull { state -> state.findCustomTabOrSelectedTab(customTabId) }
              .ifChanged { it.content.download }
              .collect { state ->
                  // Yay, I have the whole session state and can get
                  // to the download by using state.content.download
              }
      }
      ```
      Co-authored-by: default avatarSebastian Kaspari <s.kaspari@gmail.com>
      b2f19348
    • Sebastian Kaspari's avatar
    • MozLando's avatar
      Merge #4331 · a49e4410
      MozLando authored
      
      
      4331: Make BrowserAction names consistent r=pocmo a=csadilek
      
      Very minor refactoring, but since I just noticed. We could also decide to remove `Action` from all names, as they are usually prefixed with their type e.g. `TabListAction.AddTab`. Either way, I think we should keep them consistent.
      Co-authored-by: default avatarChristian Sadilek <christian.sadilek@gmail.com>
      a49e4410
  2. 05 Sep, 2019 20 commits
  3. 04 Sep, 2019 17 commits