Skip to content

Commit

Permalink
Add OpenFeature apply method
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcardell committed Sep 10, 2024
1 parent 3ef7e1d commit 4258c31
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,16 @@ trait OpenFeature[F[_]] {
def client: F[FeatureClient[F]]
}

protected[openfeature] class OpenFeatureSdk[F[_]: Monad](provider: Provider[F])
extends OpenFeature[F] {
object OpenFeature {

def client: F[FeatureClient[F]] =
new FeatureClientImpl[F](provider, EvaluationContext.empty).pure[F].widen
def apply[F[_]: Monad](provider: Provider[F]): OpenFeature[F] =
new OpenFeature[F] {

def client: F[FeatureClient[F]] =
new FeatureClientImpl[F](provider, EvaluationContext.empty)
.pure[F]
.widen[FeatureClient[F]]

}

}

0 comments on commit 4258c31

Please sign in to comment.