https://kotlinlang.org logo
Docs
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
orbit-mvi
  • m

    Mikolaj Leszczynski

    02/10/2022, 10:57 AM
    Orbit v4.3.2 is released https://github.com/orbit-mvi/orbit-mvi/releases/tag/4.3.2 This is a minor release with the following features: Features • Initial state can now be omitted when putting the ContainerHost in test mode, in which case the real initial state will be used • Jetpack Compose version updated to 
    1.1.0
    Fixes • Jetpack Compose collect functions now correctly subscribe only when the lifecycle owner is at least 
    STARTED
    •
    repeatOnSubscription
     used to hang forever in unit tests - now it always executes in a unit test As always, massive thank you to our community for the suggestions, discussions and contribution 🙇 If you’re using Compose, do check it out as it fixes an important issue with Compose extensions! @Rak you might want to take a look at this one for unit test improvements
    🎉 8
    o
    • 2
    • 1
  • g

    Guilherme Delgado

    02/10/2022, 7:14 PM
    Hi guys! I’m experiencing a strange behaviour. My container is getting created 2 times and thus the init (
    onCreate: ((state: STATE) -> Unit)?
    ) it’s called 2 times. I’m using jetpack compose: • ActivityA has ViewModelA and everything is ok. • ActivityB has a NavHost with 3 composable (“screens”). When they’re first created I get this 2 time problem, but after that, when I change between them, the container is created only once as expected. For now, this is the best hint I can give you, but I’ll look deeper. Any clue? Thanks for your time.
    m
    • 2
    • 4
  • b

    Benoît

    02/22/2022, 9:05 AM
    Hey guys, I've got a question about the internals of Orbit, why is the
    intent
    function using
    runBlocking
    ? What's the point of using a
    CoroutineScope
    when creating the
    ContainerHost
    like so
    scope.container(...)
    ?
    ➕ 1
    m
    • 2
    • 15
  • g

    Guilherme Delgado

    02/23/2022, 12:57 PM
    Hello! I’ve a question for the authors regarding this:
    fun <STATE : Parcelable, SIDE_EFFECT : Any> ViewModel.container(...)
    Why forcing 
    kotlinx.parcelize.Parcelize
     when we could also use 
    kotlinx.serialization.Serializable
     ? 🤔 According to the docs if we want to store something in disk, Serializable would be preferable, where Parcelize would be the choice for IPC situations. SaveStateHandle also supports Serializable What do you think about adding an extension that receives as 
    STATE: Serializable
    ?
    m
    a
    • 3
    • 6
  • b

    Benoît

    02/25/2022, 8:56 AM
    Hey guys, using Orbit's testing framework, how can I test this?
    containerHost.assert( initialState ) {
        states({ dataFromCache })             // first state
        refreshCache()                        // update cache
        states({ updatedDataFromCache }).     // updated state emitted AFTER cache update
    }
    For some reason the 1st option fails fails, but if I run the following it passes:
    refreshCache() 
    containerHost.assert( initialState ) {
        states({ dataFromCache }, { updatedDataFromCache })
    }
    However, the 2nd option doesn't guarantee that the second state was only emitted after the
    refreshCache()
    function was called. It feels like there's no way to assert the timing at which new states are emitted using the
    states
    function. Any idea?
    a
    m
    • 3
    • 4
  • g

    Guilherme Delgado

    03/14/2022, 11:43 AM
    Hello @Mikolaj Leszczynski @appmattus! Do you think it would be useful to have
    ContainerHostExtensions.kt
    using
    state: Lifecycle.State = Lifecycle.State.STARTED
    as a parameter? 🤔 This way if for some reason we need to change it, we could.
    a
    m
    • 3
    • 10
  • b

    Benoît

    03/14/2022, 2:58 PM
    Hey guys, I'm trying to understand the difference between
    test()
    and
    liveTest()
    From what I understand,
    liveTest()
    creates a real container host whereas
    test()
    creates a "fake" one. The
    test()
    function has an
    isolateFlow
    boolean, if set to
    true
    (default value) then it will only test 1 intent. If an intent is fired inside another intent, the 2nd intent won't run.
    containerHost.testIntent {
        change1()
        change2()
    }
    containerHost.assert(initialState) {
        states(
            {
                copy(...)
            },
            {
                copy(...)
            }
        )
    }
    If I run it with
    test(isolateFlow = true)
    or with
    liveTest()
    I get the same error "expected states but never received" But when I run it with
    test(isolateFlow = false)
    then my test passes Shouldn't be the opposite? Shouldn't
    liveTest()
    behave like
    test(isolateFlow = false)
    ?
    m
    • 2
    • 4
  • r

    Rak

    03/15/2022, 11:24 AM
    Hi, is the general consensus that sharing viewmodels across screens is bad? Its better to have unique viewmodels with their own state/side effect class?
    ➕ 1
    b
    • 2
    • 8
  • s

    Sami Eljabali

    03/16/2022, 4:17 AM
    Hi all, could use help setting up Orbit MVI on KMM. • orbit-sample-posts-multiplatform project doesn't seem to build for iOS off the bat. ◦
    unable to open file (in target "iosApp" in project "iosApp")
    • When following sample project & adding to Podfile : ◦
    pod 'sharedOrbitSwift', :path => '../shared'
    ◦ In running
    pod install
    get: ▪︎
    No podspec found for "sharedOrbitSwift" in "../shared"
    • orbit-swift-gradle-plugin, What's it for? Is it necessary to run Orbit MVI in KMM? Readme doesn't say much. • Here's my sample project. I'm a big Orbit fan(placed you guys on various awesome-lists 😄). I promise to write up adequate documentation covering KMM setup once we figure this out. (I'm counting on you guys sticking around.) (See my sample project Readme as reference) Thanks!
    👍 1
    a
    g
    • 3
    • 3
  • m

    miqbaldc

    03/18/2022, 3:42 AM
    Any suggestions/ideas to fetch paginations list until it becames empty in one
    intent
    ? Our attempts in 🧵
    • 1
    • 4
  • r

    Rak

    03/18/2022, 9:24 PM
    Hi, I came across this talk, where the guy is criticising MVI. I’m struggling to understand his objections, do you know what he means?

    https://www.youtube.com/watch?v=q7y6NQ_ou0A▾

    b
    j
    +2
    • 5
    • 13
  • h

    Hitesh Chopra

    03/19/2022, 1:18 PM
    Hi, is it necessary to have atleast 1 state for a viewmodel?
    a
    • 2
    • 1
  • h

    Hitesh Chopra

    03/19/2022, 2:29 PM
    My tests are failing due to different object instances even though the side effects are same.
    Expected :
    [LoadingSideEffects$NavigateToLandingPage@4bc90c14]
    Actual   :
    [LoadingSideEffects$NavigateToLandingPage@46a28b7f]
    My side effect -:
    class NavigateToLandingPage(val id:String) : LoadingSideEffects()
    However when I try the same on side effects with no parameters, then the tests are passing e.g
    object NavigateToLandingPage : LoadingSideEffects()
    The latter will pass, however the former will fail. For assertion, I am using
    viewModel.assert(initialState = initialState) {
        postedSideEffects(
            LoadingSideEffects.NavigateToLandingPage(scheduleId)
        )
    }
    This fails. If I use,
    val result = viewmodel.testIntent {
        fetchStatus(id)
    }
    
    assert(result.sideEffectObserver.values.first() is LoadingSideEffects.NavigateToLandingPage)
    This passes Is this (result.sideEffectObserver.values.first()) the right way to test? And does it mean that we cannot use the format.
    viewModel.assert(initialState = initialState) { }
    when our side effect accepts some values/parameters?
    o
    • 2
    • 3
  • o

    Oleksii Malovanyi

    03/21/2022, 2:51 PM
    Hey guys, the context: we want to process user input from the TextField (Compose) through the state – so
    onValueChange
    triggers
    intent
    and
    reduce
    that creates a new state which is propagated into this TextField as a
    value
    ; the problem: orbit seems to be too slow to reduce the text into new state object if the user taps quickly - text field shows funny text. Has anyone faced with this problem? What is your solution? Currently we gave up idea to hold the TextField text in the state of container and keep it in the Composable’s remeberSaveable
    a
    b
    • 3
    • 6
  • g

    Guilherme Delgado

    03/24/2022, 2:04 PM
    Hi guys, Just a curiosity for the authors. Regarding your KMM implementation, have you looked into https://github.com/rickclephas/KMP-NativeCoroutines or you don’t want this kind of dependency in your framework? I’m doing some tests by managing it by myself and now I’m trying the same but using KMP-NativeCoroutines. What are your thoughts about it? Thanks!
    b
    • 2
    • 4
  • r

    Rak

    03/28/2022, 2:38 PM
    Hi, if i did want to write activity/fragment tests, whats the best way? Mock the viewmodel and what it exposes or directly call the render/sideeffect methods or something else?
    b
    • 2
    • 2
  • g

    Guilherme Delgado

    04/08/2022, 7:30 PM
    Anyone running into something similar? KMM - kotlin.native.concurrent.InvalidMutabilityException
    m
    • 2
    • 9
  • g

    Guilherme Delgado

    04/19/2022, 1:37 PM
    @Mikolaj Leszczynski here’s a working sample with my state persistence approach: https://github.com/GuilhE/Expressus
    👏 2
    m
    • 2
    • 2
  • g

    Guilherme Delgado

    04/19/2022, 1:37 PM
    it’s also the playground for my latest story: https://guidelgado.medium.com/kotlin-multiplatform-mobile-sharing-the-ui-state-management-a67bd9a49882
    ❤️ 2
    :thank-you: 1
    j
    r
    m
    • 4
    • 14
  • a

    appmattus

    06/01/2022, 4:49 PM
    it's nice to see googles samples finally moving in this direction! the thing i found interesting though is the inconsistencies between the different public functions... as an example looking at AddEditTaskViewModel, whether its the positioning of viewModelScope.launch or the state.update calls. don't get me wrong, the codes not incorrect, but it does tend to look messier. its one of the reasons we were strict with our API, forcing you to wrap your public functions in intent blocks - non-blocking by default, as well reduce only being accessibly internally
    ➕ 3
    g
    • 2
    • 1
  • r

    Ravi

    06/03/2022, 10:22 AM
    https://medium.com/androiddevelopers/viewmodel-one-off-event-antipatterns-16a1da869b95 any thoughts on this as I’m using
    SideEffect
    pattern from
    orbit-mvi
    m
    k
    +3
    • 6
    • 14
  • g

    Guilherme Delgado

    06/22/2022, 1:25 PM
    Hi guys! I know you must be busy and with other priorities at hand, but do you have any idea when will you have spare time to look into this PR? Thanks 🙂
    ❤️ 1
    m
    a
    • 3
    • 18
  • g

    Guilherme Delgado

    07/13/2022, 1:46 PM
    👀 https://twitter.com/Zhuinden/status/1547119623732174849?s=20&amp;t=CR9hhgIGKkaNsqwwXB2iCg
    🤔 4
    i
    j
    • 3
    • 3
  • r

    Ravi

    07/27/2022, 8:39 AM
    https://github.com/orbit-mvi/orbit-mvi/issues/128 any suggestions for this issue
    m
    • 2
    • 1
  • g

    Guilherme Delgado

    08/12/2022, 9:55 AM
    Hello guys! @appmattus @Mikolaj Leszczynski any ETA for the swif-gradle-plugin to be updated (it’s on pause since kotlin 1.5.X)? It would be awesome to have it working and I believe it would push forward Orbit-Mvi adoption. I can try to help, just point me towards the problem 😉 Thanks 🙏
    m
    • 2
    • 1
  • r

    Ravi

    08/17/2022, 1:21 PM
    Whenever I’m changing list present in state below crash happening, It is intermittent and happens when i scroll the lazyverticalgrid very fast. Compose version -
    1.2.0-beta02
    • 1
    • 3
  • m

    miqbaldc

    08/28/2022, 11:26 PM
    https://github.com/freeletics/FlowRedux the MVI authors @Hannes along with @Gabriel Ittner wrote a State Machine MVI library, any though on this? *I just got this from Android Weekly newsletter
    m
    g
    e
    • 4
    • 11
  • m

    miqbaldc

    09/01/2022, 3:44 AM
    Is there any alternative to calls
    async {
    builder inside
    intent {
    ? Code in 🧵
    • 1
    • 2
  • m

    Mikolaj Leszczynski

    09/25/2022, 6:40 AM
    After what feels like ages fighting our release pipeline, Orbit
    4.4.0
    has been released! This release focuses on unit testing fixes and improvements. https://github.com/orbit-mvi/orbit-mvi/releases/tag/4.4.0
  • g

    Guilherme Delgado

    09/27/2022, 10:26 PM
    don’t want to be a pain in the ass, but any news about the swift plugin? 😇
    m
    • 2
    • 3
Powered by Linen
Title
g

Guilherme Delgado

09/27/2022, 10:26 PM
don’t want to be a pain in the ass, but any news about the swift plugin? 😇
m

Mikolaj Leszczynski

09/28/2022, 4:35 AM
@appmattus might be able to answer that 😛
I have zero knowledge of that part of the code
g

Guilherme Delgado

10/04/2022, 9:21 PM
🦗 😅
View count: 7