SHARE
TWEET

Untitled

a guest Oct 9th, 2019 95 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public func fetchCourses() -> Single<[MbyCourse]> {
  2.         return Single.create { [unowned self] single in
  3.             do {
  4.                 var fetchCourses: [MbyCourse] = []
  5.                 //                let chapters: [Org]!
  6.                 try self.dbPool.read { db in
  7.                     fetchCourses = try MbyCourse.fetchAll(db)
  8.                 }
  9.                 single(.success(fetchCourses))
  10.             } catch {
  11.                 print("error: \(error)")
  12.                 single(.error(error))
  13.             }
  14.             return Disposables.create {}
  15.         }
  16.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top