airbnb / mavericks

Mavericks: Android on Autopilot
https://airbnb.io/mavericks/
Apache License 2.0
5.85k stars 499 forks source link

Expose state restoration functions #611

Closed elihart closed 2 years ago

elihart commented 2 years ago

Refactors the state bundle creation and restoration so we can re use it for other purposes (namely Compose integrations). Similarly, exposes the state class immutability validations as well as creates a new one using kotlin reflect that can catch improper usage of Mutable collections.

codecov-commenter commented 2 years ago

Codecov Report

Merging #611 (d5d5dbe) into main (f44e85b) will increase coverage by 0.32%. The diff coverage is 80.48%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #611      +/-   ##
==========================================
+ Coverage   55.06%   55.38%   +0.32%     
==========================================
  Files          53       54       +1     
  Lines        2508     2533      +25     
  Branches      326      335       +9     
==========================================
+ Hits         1381     1403      +22     
- Misses        976      979       +3     
  Partials      151      151              
Impacted Files Coverage Δ
.../airbnb/mvrx/hilt/HiltMavericksViewModelFactory.kt 18.18% <0.00%> (ø)
...main/kotlin/com/airbnb/mvrx/MavericksExtensions.kt 8.18% <0.00%> (ø)
...tlin/com/airbnb/mvrx/mocking/KotlinReflectUtils.kt 65.90% <80.00%> (+7.28%) :arrow_up:
...tlin/com/airbnb/mvrx/MavericksViewModelProvider.kt 90.47% <80.00%> (+1.76%) :arrow_up:
...otlin/com/airbnb/mvrx/MavericksMutabilityHelper.kt 78.94% <100.00%> (+1.16%) :arrow_up:
.../main/kotlin/com/airbnb/mvrx/MavericksViewModel.kt 60.71% <100.00%> (ø)
...rx/src/main/kotlin/com/airbnb/mvrx/PersistState.kt 79.16% <100.00%> (-1.10%) :arrow_down:
...com/airbnb/mvrx/MavericksViewModelConfigFactory.kt 73.68% <0.00%> (ø)
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update a0c3dc0...d5d5dbe. Read the comment docs.