Skip to content

Commit

Permalink
Refactored value(for:)
Browse files Browse the repository at this point in the history
  • Loading branch information
yakovmanshin committed May 12, 2024
1 parent b29c3f5 commit dc76b1a
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions Sources/YMFF/FeatureFlagResolver/FeatureFlagResolver.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ final public class FeatureFlagResolver {
extension FeatureFlagResolver: FeatureFlagResolverProtocol {

public func value<Value>(for key: FeatureFlagKey) async throws -> Value {
let retrievedValue: Value = try await retrieveFirstValue(forKey: key)

return retrievedValue
try await retrieveFirstValue(forKey: key)
}

public func setValue<Value>(_ newValue: Value, toMutableStoreUsing key: FeatureFlagKey) async throws {
Expand Down Expand Up @@ -115,9 +113,7 @@ extension FeatureFlagResolver: FeatureFlagResolverProtocol {
extension FeatureFlagResolver: SynchronousFeatureFlagResolverProtocol {

public func valueSync<Value>(for key: FeatureFlagKey) throws -> Value {
let retrievedValue: Value = try retrieveFirstValueSync(forKey: key)

return retrievedValue
try retrieveFirstValueSync(forKey: key)
}

public func setValueSync<Value>(_ newValue: Value, toMutableStoreUsing key: FeatureFlagKey) throws {
Expand Down

0 comments on commit dc76b1a

Please sign in to comment.