Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass FragmentId to FeatureFactory. #399

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ abstract class FeatureFactory<in Dependencies, in Key : FragmentKey> {

inner class Params(
val dependencies: @UnsafeVariance Dependencies,
val fragmentId: FragmentId,
val key: @UnsafeVariance Key,
)

Expand All @@ -50,7 +51,7 @@ abstract class FeatureFactory<in Dependencies, in Key : FragmentKey> {
/**
* Initializes state observable and a view factory for a specific [key].
*/
fun initialize(dependencies: Dependencies, key: Key): Feature {
return Params(dependencies, key).initialize()
fun initialize(dependencies: Dependencies, fragmentId: FragmentId, key: Key): Feature {
return Params(dependencies, fragmentId, key).initialize()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ data class FragmentEnvironment(
dependencies: DependenciesT,
key: KeyT,
): Feature {
return factory.initialize(dependencies, key)
return factory.initialize(dependencies, fragmentId, key)
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ internal class MappedFeatureFactory<Component, Dependencies, Key : FragmentKey>(
override fun Params.initialize(): Feature {
return delegate.initialize(
dependencies = toDependencies(dependencies),
fragmentId = fragmentId,
key = key,
)
}
Expand Down
Loading