Skip to content

Latest commit

 

History

History
23 lines (14 loc) · 1.11 KB

ADR#2 Going Reactive (Done).md

File metadata and controls

23 lines (14 loc) · 1.11 KB

Architecture Decision Record (ADR) #2: Going Reactive ✅

  1. Replace all operations in the domain's logic with Kotlin's Flow asynchronous data-stream API so they'll automatically react to data changes by emitting new values.

  2. Leverage reactive data sources:

  • Room DB Flow DAOs
  • DataStore Flow
  1. Encapsulate use-cases in FlowAction.

Problem

Ivy Wallet UI should update every time [transaction, account, category, exchange rate, base currency, ...] change. Doing this imperatively inceases complexity and make ViewModels gigantous!

Solution

Go reactive by migrating to Kotlin Flows. See Flow Actions.

Benefits

  • The app will react automatically to data changes.
  • Flows can introduce out-of-the-box caching and efficient async processing.
  • Reducing complexity by not thinking which states we need to update imperatively (manually).