https://kotlinlang.org logo
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

    08/05/2021, 7:12 AM
    Our very own @appmattus did a review of competing MVI libraries and has come up with some interesting conclusions. Well worth a read! https://proandroiddev.com/top-android-mvi-libraries-in-2021-de1afe890f27
    🔥 5
    🙌 5
    :kotlin-intensifies: 1
    o
    m
    • 3
    • 8
  • e

    Eric Ampire [MOD]

    08/05/2021, 10:21 AM
    Hello, it seems like the version 4.2.0 is not yet available
    > Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
       > Could not find org.orbit-mvi:orbit-core:4.2.0.
         Searched in the following locations:
    <https://dl.google.com/dl/android/maven2/org/orbit-mvi/orbit-core/4.2.0/orbit-core-4.2.0.pom>
    <https://repo.maven.apache.org/maven2/org/orbit-mvi/orbit-core/4.2.0/orbit-core-4.2.0.pom>
    <https://jcenter.bintray.com/org/orbit-mvi/orbit-core/4.2.0/orbit-core-4.2.0.pom>
    m
    a
    • 3
    • 4
  • e

    Eric Ampire [MOD]

    08/05/2021, 3:19 PM
    I want to have something like that sealed class ProfileViewState object Loading : ProfileViewState() object Error : ProfileViewState() data class ProfileLoaded( val name: String, val email: String ) : ProfileViewState()
    m
    m
    • 3
    • 14
  • o

    Oleksii Malovanyi

    08/09/2021, 3:31 PM
    Correct me if I’m wrong but the latest
    2.4.0
    release uses alpha version of androidx.lifecycle library. I have a wish and a request to write about things like this (alpha/beta versions of 3rd party dependencies) in release notes, maybe even with extra exclamation marks ⚠️ E.g. for us it’s a blocker to update orbit to
    2.4.0
    as we don’t have much faith in google’s alpha-beta quality…
    a
    m
    • 3
    • 7
  • g

    Guilherme Delgado

    08/11/2021, 9:27 PM
    Hello! I stumbled upon Orbit-MVI and I’m very motivated to try it out. Do you think we can also benefit from using it with a StateMachine - let’s say in the reduce function - so we can have a better control over the State? Have you tried?
    m
    o
    • 3
    • 8
  • g

    Guilherme Delgado

    08/12/2021, 8:42 AM
    I’ve a question regarding
    intent
    , I’ll add details in thread:
    m
    m
    a
    • 4
    • 12
  • s

    Stephan Schuster

    08/23/2021, 8:53 AM
    Hi! I am currently evaluating orbit-mvi and uniflow-kt (still on theoretical level). Since I am quite new to these topics, I already asked a lot of questions in the #uniflow channel. Not all of them have been answered so far. Feel free to provide your point of view on those and additional aspects here. I am especially interested in the following (see comments):
    m
    a
    • 3
    • 23
  • s

    Simon

    09/01/2021, 3:00 PM
    Hi! I am quite new to MVI, but your library looks very promising 🙂 I started looking into the orbit-sample-stocklist-jetpack-compose and how flow is used there for the request of the stocks. In the example the flows live as long as the ViewModel does. What would be the intended way of managing those flows with Orbit in case I need to close and open it again (e.g. with different parameters if I would have some kind of filter functionality). I already found this question in the github repo: https://github.com/orbit-mvi/orbit-mvi/issues/12 As far as I understand the suggestion there is to create coroutineScopes and cancel the previous Job if a new subscription is required. This works, but is there any better way in the meantime or is this still as intended?
    a
    m
    • 3
    • 6
  • e

    Eric Ampire [MOD]

    09/04/2021, 8:54 PM
    Hello everyone, Is there a problem with this code that can cause the state not to be modified? The logs display very well when there is an error or when the operation is successful but at the view level the state has always the default value
    private fun Flow<Result<List<Lottiefile>>>.fetchData() = intent(registerIdling = false) {
        collect { result ->
          when(result) {
            is Result.Error -> {
              Timber.e(result.toString())
              val errorMessage = result.exception.localizedMessage ?: "Unknown Error"
              reduce { state.copy(isLoading = false) }
              postSideEffect(ExploreEffect.ShowErrorMessage(errorMessage))
            }
            Result.Loading -> {
              Timber.e(result.toString())
              reduce { state.copy(isLoading = true) }
            }
            is Result.Success -> {
              Timber.e(result.toString())
              reduce { state.copy(files = result.data, isLoading = false) }
            }
          }
        }
      }
    The state is collected like that
    val state by viewModel.container.stateFlow.collectAsState()
    m
    o
    • 3
    • 5
  • g

    Guilherme Delgado

    09/16/2021, 1:56 PM
    Btw, any update on this: https://github.com/orbit-mvi/orbit-mvi/issues/20 (it’s in progress, good news 🙂 )
    a
    • 2
    • 11
  • o

    Oleksii Malovanyi

    09/17/2021, 2:29 PM
    Hey guys, what do you think about tweaking the
    runOnCreate
    function so one could subscribe to container from it -> currently it’s impossible due to compilation restrictions, so in case of ViewModel we have to subscribe from the `init{}`which then could affect tests which don’t wanna run
    runOnCreate
    on TestContainer
    ➕ 1
    a
    m
    • 3
    • 28
  • g

    Guilherme Delgado

    09/27/2021, 12:04 PM
    Hi guys, just a quick question: Since you’ve logic regarding to SaveStateHandle (which it’s pretty handy), if for some reason I don’t want to store a specific member - let’s say a complex list - how should I do it? Mark it as
    @IgnoredOnParcel
    ? Thanks!
    m
    a
    • 3
    • 2
  • s

    Stephan Schuster

    10/12/2021, 9:37 AM
    Hi, we just finished our first little project based on a (for us) completely new technology stack including Orbit. We only touched its core features but so far we are really happy with it. Now that I am more into MVI, Kotlin, Coroutines, Flows, Compose etc. I can confirm what was initially more a gut feeling: Orbit is the right choice (for us) when it comes to MVI frameworks. Its technical foundation naturally fits to the rest of a modern technology stack. Using the same standard concepts across all architectural layers makes things easier, slick and seamless. So once again, thank you for answering all my stupid question a few weeks back and bringing me on the right track.
    ❤️ 1
    :thank-you: 1
    👏 1
    m
    • 2
    • 1
  • s

    Stephan Schuster

    10/12/2021, 9:48 AM
    Hi again, as part of some architecture documentation I created the attached diagram. Does this make sense? Is it correct in terms of Orbit?
    :thank-you: 1
    👏 1
    ❤️ 1
    m
    m
    s
    • 4
    • 19
  • k

    kenkyee

    10/13/2021, 7:13 PM
    quick question on savedstate handling...is there a way to save only a partial bit of your viewmodel? e.g. just an ID to reload data with? or a Paging offset e.g. I didn't see anything in the API to do this...
    m
    o
    • 3
    • 18
  • k

    kenkyee

    10/13/2021, 7:30 PM
    Another quick question: if you have a multistage intent, can you have multiple reduce calls interspersed w/ network/db calls? e.g. reduce { state.copy(loading = true) } val results = loadstuff.await() reduce { state.copy(loading = false, data = results, loadingPhase2 = true) } val results2 = loadmorestuff.await() reduce { state.copy(loadingPhase2 = false, extradata = results2) }
    m
    m
    b
    • 4
    • 7
  • g

    Guilherme Delgado

    10/15/2021, 8:33 AM
    Just finished a new POC with Orbit on KMM grounds. Not yet ready to make it public (SwiftUI time), but I can share a quick feedback about KMM/Android: ❤️ - there you go. A quick question: I know there’s no SavedStateHandle logic in KMM, but how one can save state when sharing ViewModels? 🤔 Is it even possible?
    a
    m
    • 3
    • 25
  • k

    kenkyee

    10/15/2021, 11:00 AM
    Question for folks using this in production...how do you handle savedstate (for app resurrection) when you only want to save part of your state but your screen state includes large lists of items? E.g. saving the paging offset of an infinite scroll list... You can't just mark your entire state class as parcelable because that would include your item list.
    o
    • 2
    • 3
  • k

    kenkyee

    10/15/2021, 12:24 PM
    In the last video on Orbit, there was a mention of adding a timetravel feature...I didn't see an issue on design for it. Was mostly curious if there's a hook for watching the state transitions to add debugging logs.
    m
    m
    • 3
    • 6
  • k

    kenkyee

    10/15/2021, 12:26 PM
    For guardrails, is there anything that checks for people using vars or mutable state in data classes? Something like what mavericks has done: https://airbnb.io/mavericks/#/debug-checks
    a
    • 2
    • 4
  • b

    Benoît

    10/22/2021, 2:38 PM
    Hey guys, I'm considering using orbit-mvi for our project, currently I'm using MobiusKt by Drew Carlson but the lack of union types in Kotlin makes it too verbose. We are building a Multiplatform project, is there anything specific that needs to be done, or something to be aware of, when writing code with orbit-mvi for iOS?
    a
    g
    • 3
    • 8
  • b

    Benoît

    10/25/2021, 9:10 PM
    Hi everyone, I have been playing around with Orbit-MVI lately and I really like its simplicity. However, after using Mobius for a long time I'm not too sure what the best practices are. So here's my problem. I usually represent my network calls as suspend function returning and Either from the Arrow library. In Mobius, when consuming an Either I would just call
    fold()
    and dispatch and effect on the left case (error), and a new state on the right case (success), within the same
    fold()
    Using Orbit-MVI I either have to fold the
    apiResponse
    twice in the reduce block and the suspend block from the
    intent
    (option1), or do the
    fold()
    outside the reduce block but then the fold is happening in the impure world which isn't good practice in my opinion. Which option do you think is best, and is there any alternative to achieve this?
    k
    m
    a
    • 4
    • 81
  • o

    Oleksii Malovanyi

    10/28/2021, 7:59 AM
    Hey guys, yesterday lifecycle 2.4.0 was released which is a big deal 🎉 Just wonder is it planned to update orbit to 4.2.x with this stable dependency?
    :kotlin-intensifies: 1
    m
    a
    b
    • 4
    • 7
  • k

    kenkyee

    11/01/2021, 2:50 PM
    if there is ever a 3.0, it would be nice to rename SimpleSyntax -> SimpleReducer. If you extract on a function, AS will generate this currently:
    private suspend fun SimpleSyntax<TaskScreenState, TaskScreenSideEffect>.addTaskReducer(
        onComplete: () -> Unit
    ) {
    hmm....technically, that's not a reducer though... 🤔 but SimpleSyntax is an odd name for this too.
    a
    • 2
    • 1
  • k

    kenkyee

    11/01/2021, 6:22 PM
    for a unit test, if an intent calls another intent, the 2nd intent doesn't seem to get executed. Is this expected? Works fine when. running the app live though...the 2nd intent does get run. 2nd intent was done that way get access to reduce, etc. but was intended to be shared code. Is the proper way to do this to pass the SimpleSyntax context along to the shared code?
    m
    • 2
    • 6
  • g

    Guilherme Delgado

    11/04/2021, 1:46 PM
    Hi guys! I’m trying to open a KMM project to code iOS module and it fails to build with:
    a
    • 2
    • 76
  • k

    kenkyee

    11/04/2021, 4:20 PM
    Is there any way to run intents multiple times in debug mode to verify that they don't have side effects (aka idempotent) like you can do with redux reducers or Mavericks?
    m
    • 2
    • 18
  • g

    Guilherme Delgado

    11/08/2021, 11:30 AM
    Hello! Looking into KMM sample I have a question regarding iOS state object
    k
    • 2
    • 8
  • k

    kenkyee

    11/12/2021, 12:37 PM
    Is it possible to add time travel to Orbit? Was looking at the issue tracker and wondering how it can be done without formal classes for intents to save all the parameters... Noticed Mavericks also doesn't have this and it's a similar MVVM+ MVI architecture instead of a more formal MVI one with the extra boilerplate...
    m
    • 2
    • 6
  • m

    Mikolaj Leszczynski

    11/15/2021, 7:48 AM
    Orbit MVI 4.3.0 has been released! 🎉 https://github.com/orbit-mvi/orbit-mvi/releases/tag/4.3.0 This is a minor release fixing issues with creating DSL extensions and adding few other minor features. Highlights: • Added Compose extensions for convenience • Fixed issues for DSL extension development • Updated
    androidx.lifecycle
    to
    2.4.0
    🎉 Enjoy!
    👍 3
    :thank-you: 1
    🎉 5
    b
    • 2
    • 5
Powered by Linen
Title
m

Mikolaj Leszczynski

11/15/2021, 7:48 AM
Orbit MVI 4.3.0 has been released! 🎉 https://github.com/orbit-mvi/orbit-mvi/releases/tag/4.3.0 This is a minor release fixing issues with creating DSL extensions and adding few other minor features. Highlights: • Added Compose extensions for convenience • Fixed issues for DSL extension development • Updated
androidx.lifecycle
to
2.4.0
🎉 Enjoy!
👍 3
:thank-you: 1
🎉 5
@Benoît you might want to look at this one 🙂
b

Benoît

11/15/2021, 9:25 AM
Thanks!
m

Mikolaj Leszczynski

11/15/2021, 9:26 AM
Docs still need updating though... Sorry you had to wait so long but I have quite a difficult period in my life right now.
🙏 1
b

Benoît

11/15/2021, 9:52 AM
no problem at all I was using a dirty hack in the meantime 😄
m

Mikolaj Leszczynski

11/15/2021, 10:10 AM
you can always jitpack your own fork 😉
View count: 3