Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public func fetchCourses() -> Single<[MbyCourse]> {
- return Single.create { [unowned self] single in
- do {
- var fetchCourses: [MbyCourse] = []
- // let chapters: [Org]!
- try self.dbPool.read { db in
- fetchCourses = try MbyCourse.fetchAll(db)
- }
- single(.success(fetchCourses))
- } catch {
- print("error: \(error)")
- single(.error(error))
- }
- return Disposables.create {}
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement