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

Add launchable markets #346

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
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 @@ -9,6 +9,10 @@
import Utilities

@objc public final class LocalFeatureFlagsCacheInteractor: LocalEntityCacheInteractor, SingletonProtocol, FeatureFlagsProtocol {
public func value<T>(feature: String, defaultValue: T) -> T {
defaultValue
}

public static var shared: LocalFeatureFlagsCacheInteractor = {
LocalFeatureFlagsCacheInteractor(key: "features", default: "features_default.json")
}()
Expand Down
11 changes: 11 additions & 0 deletions StatsigInjections/StatsigInjections/StatsigInjections.swift
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,17 @@ public final class StatsigFeatureFlagsProvider: NSObject, FeatureFlagsProtocol {
return nil
}

public func value<T>(feature: String, defaultValue: T) -> T {
let store = Statsig.getParameterStore("v4_params")
if let defaultValue = defaultValue as? StatsigDynamicConfigValue {
let result = store.getValue(forKey: feature, defaultValue: defaultValue)
if let result = result as? T {
return result
}
}
return defaultValue
}

public func customized() -> Bool {
return false
}
Expand Down
8 changes: 8 additions & 0 deletions Utilities/Utilities/_Store/FeatureFlagsStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ public class FeatureFlagsStore: UserDefaultsStore, FeatureFlagsProtocol {
}
return nil
}

public func value<T>(feature: String, defaultValue: T) -> T {
let value = value(feature: feature)
if let value = value as? T {
return value
}
return defaultValue
}

public func customized() -> Bool {
#if DEBUG
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ public class CompositeFeatureFlagsProvider: NSObject & FeatureFlagsProtocol {
}
}
}


public func value<T>(feature: String, defaultValue: T) -> T {
remote?.value(feature: feature, defaultValue: defaultValue) ?? defaultValue
}

public func isOn(feature: String) -> Bool? {
switch Installation.source {
case .appStore, .jailBroken:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ public protocol FeatureFlagsProtocol {
func refresh(completion: @escaping () -> Void)
func activate(completion: @escaping () -> Void)
func value(feature: String) -> String?
func value<T>(feature: String, defaultValue: T) -> T
func isOn(feature: String) -> Bool?

func customized() -> Bool
}

Expand Down
1 change: 1 addition & 0 deletions dydx/PodFile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ end

def abacus_pods
#pod 'abacus', :path => '~/v4-abacus'
cccccbrgcggblcucvihifbbidlutfrcvrffnvvvhgfkt
pod 'Abacus', :podspec => '../podspecs/Abacus.podspec'
end

Expand Down
18 changes: 9 additions & 9 deletions dydx/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PODS:
- Abacus (1.13.46)
- AmplitudeSwift (1.11.3):
- Abacus (1.13.50)
- AmplitudeSwift (1.11.4):
- AnalyticsConnector (~> 1.3.0)
- AnalyticsConnector (1.3.1)
- AppsFlyerFramework (6.16.0):
Expand Down Expand Up @@ -223,10 +223,10 @@ PODS:
- GoogleUtilities/UserDefaults (8.0.2):
- GoogleUtilities/Logger
- GoogleUtilities/Privacy
- GTMSessionFetcher (4.2.0):
- GTMSessionFetcher/Full (= 4.2.0)
- GTMSessionFetcher/Core (4.2.0)
- GTMSessionFetcher/Full (4.2.0):
- GTMSessionFetcher (4.3.0):
- GTMSessionFetcher/Full (= 4.3.0)
- GTMSessionFetcher/Core (4.3.0)
- GTMSessionFetcher/Full (4.3.0):
- GTMSessionFetcher/Core
- HMSegmentedControl (1.5.6)
- iCarousel (1.8.3)
Expand Down Expand Up @@ -379,8 +379,8 @@ CHECKOUT OPTIONS:
:git: https://github.com/dydxprotocol/Charts.git

SPEC CHECKSUMS:
Abacus: cf30eb6a1327ae11e106af02d8022414ef049bf8
AmplitudeSwift: 2e4c83a17a83262e32cd5b05ce11737a26ec3244
Abacus: f5b4140686f5d9556f275d811fea274d6c253c04
AmplitudeSwift: 1e64ee50853f0bab85d3f450770055585d5747ff
AnalyticsConnector: 3def11199b4ddcad7202c778bde982ec5da0ebb3
AppsFlyerFramework: 4e88540b96c0bd57c5cfffbac63e392387e44b93
Atributika: ecedf5259e4aa3c6278d840b6c18d60c1a8b6ca0
Expand Down Expand Up @@ -411,7 +411,7 @@ SPEC CHECKSUMS:
GoogleDataTransport: aae35b7ea0c09004c3797d53c8c41f66f219d6a7
GoogleToolboxForMac: d0a675de27cb3e7fbf157925680ac8421d86c257
GoogleUtilities: 26a3abef001b6533cf678d3eb38fd3f614b7872d
GTMSessionFetcher: 4cb0aa086996858328a1fca61f9bfe81cfdfdfa9
GTMSessionFetcher: 257ead9ba8e15a2d389d79496e02b9cc5dd0c62c
HMSegmentedControl: 34c1f54d822d8308e7b24f5d901ec674dfa31352
iCarousel: d782f635afac190c49bb8ee455882284cff8b85f
JTCalendar: 1b326e0d59dd1855b52c5f3feb059d2ff953805d
Expand Down
2 changes: 1 addition & 1 deletion dydx/Pods/AmplitudeSwift/Sources/Amplitude/Constants.swift

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions dydx/Pods/Local Podspecs/abacus.podspec.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions dydx/Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading