Skip to content

Commit 4583dad

Browse files
committed
add docs
1 parent 92821f9 commit 4583dad

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

Sources/FirebaseRemoteConfigOpenFeatureProvider/FirebaseRemoteConfigOpenFeatureProvider.swift

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ public final class FirebaseRemoteConfigOpenFeatureProvider: FeatureProvider {
2525

2626
return dateFormatter
2727
}()
28-
28+
29+
/// Provider status
2930
public private(set) var status: FirebaseRemoteConfigOpenFeatureProviderStatus = .notReady {
3031
didSet {
3132
switch status {
@@ -38,22 +39,35 @@ public final class FirebaseRemoteConfigOpenFeatureProvider: FeatureProvider {
3839
}
3940
}
4041
}
41-
42+
43+
/// Provider initializer
44+
///
45+
/// This initilizer updates provider status belong with remote config instance. Also it starts observing notification for remoteConfig update.
46+
/// - Parameter remoteConfig: remoteConfig instance to provide flags
4247
public init(remoteConfig: RemoteConfigCompatible) {
4348
self.remoteConfig = remoteConfig
4449
updateStatus(for: remoteConfig)
4550
NotificationCenter.default.addObserver(self, selector: #selector(remoteConfigDidActivated), name: .onRemoteConfigActivated, object: nil)
4651
}
47-
4852

4953
deinit {
5054
NotificationCenter.default.removeObserver(self, name: .onRemoteConfigActivated, object: nil)
5155
}
5256

57+
/// Provider initializer
58+
///
59+
/// This provider does not support context
60+
/// - Parameter initialContext: initial context
5361
public func initialize(initialContext: EvaluationContext?) {
5462
updateStatus(for: remoteConfig)
5563
}
56-
64+
65+
/// Update contexts for the provider
66+
///
67+
/// This function notifies `.configurationChanged`event
68+
/// - Parameters:
69+
/// - oldContext: old context
70+
/// - newContext: new context
5771
public func onContextSet(oldContext: EvaluationContext?, newContext: EvaluationContext) {
5872
initialize(initialContext: newContext)
5973

0 commit comments

Comments
 (0)