benkuly
08/09/2021, 1:15 PMArkadii Ivanov
08/09/2021, 1:29 PMStores
- a source of State
. Decompose provides Lifecycle-aware componentization. When both libraries are used together, Stores
are usually scoped by components.
How many rows do you expect to have in your database? I have implemented a chat with MVI. A Store
contains all the messages in memory, they are loaded from the database page by page on scrolling. Changes are swapped to the database by the Store
. We had >1000 messages loaded in the Store
, the performance was fine.benkuly
08/09/2021, 1:47 PMLoadMore
and this adds more messages to the store? I think something like that could work for me.
Because I develop a library: Can the MVI-Stuff compiled to JS and used from JS (via @JsExport
)? My current own implementation of a simple store can't do that, because it uses Flow, which cannot be exported 😕Arkadii Ivanov
08/09/2021, 1:51 PMSo the store contains an Intent likeThis is exactly how I implemented it in that chat project.and this adds more messages to the store?LoadMore
Can the MVI-Stuff compiled to JS and used from JSYou should be able to hide the logic behind a facade (e.g. in the MVIKotlin samples I used a thing like "controller"). Then just export your facade. It can be a class, or an interface plus a factory function.
benkuly
08/09/2021, 2:26 PMArkadii Ivanov
08/09/2021, 2:47 PM