Skip to content

Commit

Permalink
bump
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnaud Dorgans committed Jun 22, 2018
1 parent c0930a0 commit 27605c6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
13 changes: 3 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,14 +255,8 @@ Transactions:
let db = Firestore.firestore()
let sfReference = db.collection("cities").document("SF")

db.rx.runTransaction { transaction, errorPointer in
let sfDocument: DocumentSnapshot
do {
try sfDocument = transaction.getDocument(sfReference)
} catch let fetchError as NSError {
errorPointer?.pointee = fetchError
return nil
}
db.rx.runTransaction { transaction in
let sfDocument = try transaction.getDocument(sfReference)

guard let oldPopulation = sfDocument.data()?["population"] as? Int else {
let error = NSError(
Expand All @@ -272,8 +266,7 @@ db.rx.runTransaction { transaction, errorPointer in
NSLocalizedDescriptionKey: "Unable to retrieve population from snapshot \(sfDocument)"
]
)
errorPointer?.pointee = error
return nil
throw error
}

transaction.updateData(["population": oldPopulation + 1], forDocument: sfReference)
Expand Down
2 changes: 1 addition & 1 deletion RxFirebase.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'RxFirebase'
s.version = '0.2'
s.version = '0.2.1'
s.summary = 'RxSwift extensions for Firebase.'

# This description is used to generate tags and improve search results.
Expand Down

0 comments on commit 27605c6

Please sign in to comment.