title: Composable is recomposing endlessly after flow collect
body: <p>My composable is recomposing endlessly after flow collect and navigating to a new screen.
  I can't understand why.</p>
  <p>I'm using Firebase for Auth with Email and Password.</p>
  <p>I had to put some <code>Log.i</code> to test my function and my composable, and yes, my Main composable (<code>SignUp</code>) is recomposing endlessly after navigating.</p>
  <p><strong>ViewModel</strong></p>
  <pre><code>// Firebase auth
  private val _signUpState = mutableStateOf&lt;Resources&lt;Any&gt;&gt;(Resources.success(false))
  val signUpState: State&lt;Resources&lt;Any&gt;&gt; = _signUpState
  
  fun firebaseSignUp(email: String, password: String) {
      job = viewModelScope.launch(Dispatchers.IO) {
          firebaseAuth.firebaseSignUp(email = email, password = password).collect {
              _signUpState.value = it
              Log.i(&quot;balito&quot;, &quot;polipop&quot;)
          }
      }
  }
  
  fun stop() {
      job?.cancel()
  }
  </code></pre>
  <p><strong>SignUp</strong></p>
  <pre><code>@Composable
  fun SignUp(
      navController: NavController,
      signUpViewModel: SignUpViewModel = hiltViewModel()
  ) {
      val localFocusManager = LocalFocusManager.current
      Log.i(&quot;salut&quot;, &quot;salut toi&quot;)
      Column(
          modifier = Modifier
              .fillMaxSize()
              .systemBarsPadding()
              .padding(16.dp)
              .background(color = PrimaryColor)
      ) {
          BackButton(navController = navController)
          Spacer(modifier = Modifier.height(30.dp))
          Text(
              text = stringResource(id = R.string.sinscrire),
              fontFamily = visby,
              fontWeight = FontWeight.SemiBold,
              fontSize = 28.sp,
              color = Color.White
          )
          Spacer(modifier = Modifier.height(2.dp))
          Text(
              text = stringResource(R.string.prenez_votre_sante_en_main),
              fontFamily = visby,
              fontWeight = FontWeight.SemiBold,
              fontSize = 20.sp,
              color = Grey
          )
          Spacer(modifier = Modifier.height(20.dp))
          Email(signUpViewModel = signUpViewModel, localFocusManager = localFocusManager)
          Spacer(modifier = Modifier.height(16.dp))
          Password(signUpViewModel = signUpViewModel, localFocusManager = localFocusManager)
          Spacer(modifier = Modifier.height(30.dp))
          Button(value = stringResource(R.string.continuer), type = Type.Valid.name) {
              localFocusManager.clearFocus()
              signUpViewModel.firebaseSignUp(signUpViewModel.emailInput.value, signUpViewModel.passwordInput.value)
          }
          Spacer(modifier = Modifier.height(16.dp))
          Button(value = stringResource(R.string.inscription_avec_google), type = Type.Other.name) {
  
          }
          Spacer(modifier = Modifier.weight(1f))
          Box(
              modifier = Modifier
                  .fillMaxWidth(),
              contentAlignment = Alignment.Center
          ) {
              ClickableTextInfo(stringResource(id = R.string.deja_un_compte_se_connecter), onClick = {})
          }
      }
      Response(navController = navController, signUpViewModel = signUpViewModel)
      DisposableEffect(key1 = signUpViewModel.signUpState.value == Resources.success(true)) {
          onDispose {
              signUpViewModel.stop()
              Log.i(&quot;fin&quot;, &quot;fin&quot;)
          }
      }
  }
  
  @Composable
  private fun Response(
      navController: NavController,
      signUpViewModel: SignUpViewModel
  ) {
      when (val response = signUpViewModel.signUpState.value) {
          is Resources.Loading&lt;*&gt; -&gt; {
              //WaitingLoaderProgress(loading = true)
          }
          is Resources.Success&lt;*&gt; -&gt; {
              response.data.also {
                  Log.i(&quot;lolipop&quot;, &quot;lolipopi&quot;)
                  if (it == true) {
                      navController.navigate(Screen.SignUpConfirmation.route)
                  }
              }
          }
          is Resources.Failure&lt;*&gt; -&gt; {
  //            response.throwable.also {
  //                Log.d(TAG, it)
  //            }
          }
      }
  }
  </code></pre>