Skip to content

Commit a7996d8

Browse files
committed
Reformat
1 parent 8a681c2 commit a7996d8

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

PowerSyncKotlin/src/appleMain/kotlin/com/powersync/Connector.kt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,16 @@ import com.powersync.connectors.PowerSyncCredentials
55

66
public interface SwiftBackendConnector {
77
public suspend fun fetchCredentials(): PowerSyncResult
8+
89
public suspend fun uploadData(): PowerSyncResult
910
}
1011

11-
public fun swiftBackendConnectorToPowerSyncConnector(connector: SwiftBackendConnector): PowerSyncBackendConnector {
12-
return object : PowerSyncBackendConnector() {
13-
override suspend fun fetchCredentials(): PowerSyncCredentials? {
14-
return handleLockResult(connector.fetchCredentials()) as PowerSyncCredentials?
15-
}
12+
public fun swiftBackendConnectorToPowerSyncConnector(connector: SwiftBackendConnector): PowerSyncBackendConnector =
13+
object : PowerSyncBackendConnector() {
14+
override suspend fun fetchCredentials(): PowerSyncCredentials? =
15+
handleLockResult(connector.fetchCredentials()) as PowerSyncCredentials?
1616

1717
override suspend fun uploadData(database: PowerSyncDatabase) {
1818
handleLockResult(connector.uploadData())
1919
}
2020
}
21-
}

PowerSyncKotlin/src/appleMain/kotlin/com/powersync/SDK.kt

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,15 @@ public fun createSyncOptions(
9393
clientConfiguration = createExtendedSyncClientConfiguration(loggingConfig),
9494
)
9595

96-
public fun errorHandledCrudTransactions(db: PowerSyncDatabase): Flow<PowerSyncResult> {
97-
return db.getCrudTransactions().map<CrudTransaction, PowerSyncResult> {
98-
PowerSyncResult.Success(it)
99-
}.catch {
100-
if (it is PowerSyncException) {
101-
emit(PowerSyncResult.Failure(it))
102-
} else {
103-
throw it
96+
public fun errorHandledCrudTransactions(db: PowerSyncDatabase): Flow<PowerSyncResult> =
97+
db
98+
.getCrudTransactions()
99+
.map<CrudTransaction, PowerSyncResult> {
100+
PowerSyncResult.Success(it)
101+
}.catch {
102+
if (it is PowerSyncException) {
103+
emit(PowerSyncResult.Failure(it))
104+
} else {
105+
throw it
106+
}
104107
}
105-
}
106-
}

0 commit comments

Comments
 (0)