instacart / formula

A functional reactive framework for managing state and side effects based on RxJava.
https://instacart.github.io/formula/
BSD 3-Clause Clear License
151 stars 14 forks source link

Refactor FeatureFactory public API using Params. #398

Closed Laimiux closed 2 months ago

Laimiux commented 2 months ago

What

I'm wrapping the dependencies and key into a Params object and updating FeatureFactory.initialize to get it via the extension function receiver type Params.initialize(): Feature.

Feature factory initialization changes from

override fun initialize(dependencies: Unit, key: Key): Feature

to

override fun Params.initialize(): Feature

Why

We need to pass FragmentId or something equivalent to the FeatureFactory. This change requires us to introduce a new parameter that would break existing usages. Instead of just adding a new parameter, I'm refactoring the way this public API works which will enable us to modify Params object in the future without breaking the usages.

carrotkite commented 2 months ago

JaCoCo Code Coverage 97.15% :white_check_mark:

Class Covered Meta Status
com/instacart/formula/android/FeatureFactory 100% 0% :white_check_mark:
com/instacart/formula/android/internal/MappedFeatureFactory 100% 0% :white_check_mark:

Generated by :no_entry_sign: Danger