Guest User

Untitled

a guest
Jun 13th, 2023
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Kotlin 0.61 KB | None | 0 0
  1. // This one works
  2. viewModel {
  3.  
  4.             fun getProfileFlow(): GetProfileFlow? {
  5.                 val accountId = getOrNull<Id>()
  6.                 return accountId?.let { id ->
  7.                     get(parameters = { parametersOf(id) })
  8.                 }
  9.             }
  10.  
  11.             SocialViewModel(get(), getProfileFlow())
  12.         }
  13.  
  14. // This one doesn't
  15. viewModel {
  16.             val accountId = getOrNull<Id>()
  17.             val profileFlow = accountId?.let { id ->
  18.                 get<GetProfileFlow>(parameters = { parametersOf(id) })
  19.             }
  20.             SocialViewModel(get(), profileFlow)
  21.         }
Advertisement
Add Comment
Please, Sign In to add comment