~/talk

Elevated Dependency Injection: Going Beyond the Basics with Custom Hilt Components

Talkat droidcon London 2024 · 2024-10-31..11-01· [android]
links:none on file
slides:none on file

Patreon integrates a custom Hilt component called user component that scopes dependencies per signed‑in user, providing a per‑user coroutine scope and automatic cleanup on logout so background work and caches cancel and GC without manual threading or global maps. A copy module strategy copies user bindings into activity/viewmodel graphs so direct injection compiles and feels like app‑wide singletons; team adoption grows and the presenter says it’s worth using “a 100 times” in codebases.

AI-written summary · about

  1. 0:00Custom Hilt components intro
  2. 3:56Default Hilt component limits
  3. 6:04Multi-user lifecycle issues
  4. 12:05Custom component step-by-step
  5. 15:13Access custom components in ViewModels
  6. 17:18Simplify with copy modules
  7. 21:14When to use custom components
  8. 22:18Testing custom components
  9. 24:21Are custom components right?
  10. 26:49Common pitfalls and how to avoid them
  11. 27:31Summary and demo
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.