Skip to content

Instantly share code, notes, and snippets.

@malcommac
Created January 22, 2022 22:50
Show Gist options
  • Save malcommac/122beb1a4b1f7e11bdec9f7152030d3f to your computer and use it in GitHub Desktop.
Save malcommac/122beb1a4b1f7e11bdec9f7152030d3f to your computer and use it in GitHub Desktop.
Feature Flag Service
public class FFService {
public let main = FFService()
public let user: FlagLoader<UserExperiments>
private init() {
let fileURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0]..appendingPathComponent("user_flags.xml"))
user = FlagsLoader(UserExperiments.self,
description: .init(name: "User Features", description: "Experimental lab"),
providers: [
FirebaseRemoteProvider(),
LocalProvider(localURL: fileURL)
])
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment