Skip to content

Commit

Permalink
add doc comments
Browse files Browse the repository at this point in the history
  • Loading branch information
lawmicha committed Nov 27, 2023
1 parent ea2ed4b commit 371f6bb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ final public class AWSDataStorePlugin: DataStoreCategoryPlugin {
}

#if os(watchOS)
/// No-argument init that uses defaults for all providers
/// Initializer
/// - Parameters:
/// - modelRegistration: Register DataStore models.
/// - dataStoreConfiguration: Configuration object for DataStore
public init(modelRegistration: AmplifyModelRegistration,
configuration dataStoreConfiguration: DataStoreConfiguration) {
self.modelRegistration = modelRegistration
Expand All @@ -79,7 +82,10 @@ final public class AWSDataStorePlugin: DataStoreCategoryPlugin {
self.dispatchedModelSyncedEvents = [:]
}
#else
/// No-argument init that uses defaults for all providers
/// Initializer
/// - Parameters:
/// - modelRegistration: Register DataStore models.
/// - dataStoreConfiguration: Configuration object for DataStore
public init(modelRegistration: AmplifyModelRegistration,
configuration dataStoreConfiguration: DataStoreConfiguration = .default) {
self.modelRegistration = modelRegistration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ extension DataStoreConfiguration {
/// - syncMaxRecords: the number of records to sync per execution
/// - syncPageSize: the page size of each sync execution
/// - authModeStrategy: authorization strategy (.default | multiauth)
/// - disableSubscriptions: called before establishing subscriptions. Return true to disable subscriptions.
/// - Returns: an instance of `DataStoreConfiguration` with the passed parameters.
public static func custom(
errorHandler: @escaping DataStoreErrorHandler = { error in
Expand Down Expand Up @@ -84,7 +85,10 @@ extension DataStoreConfiguration {
#endif

#if os(watchOS)
/// The default configuration.
/// Default configuration with subscriptions disabled for watchOS. DataStore uses subscriptions via websockets,
/// which work on the watchOS simulator but not on the device. Running DataStore on watchOS with subscriptions
/// enabled is only possible during special circumstances such as actively streaming audio.
/// See https://github.com/aws-amplify/amplify-swift/pull/3368 for more details.
public static var subscriptionsDisabled: DataStoreConfiguration {
.custom(disableSubscriptions: { false })
}
Expand Down

0 comments on commit 371f6bb

Please sign in to comment.