Skip to content

Instantly share code, notes, and snippets.

@Dimillian
Created November 17, 2017 14:05
Show Gist options
  • Save Dimillian/7a7da2c96e49a83b820b8beed968bef3 to your computer and use it in GitHub Desktop.
Save Dimillian/7a7da2c96e49a83b820b8beed968bef3 to your computer and use it in GitHub Desktop.
BooksCollectionAllBooksDataProvider.swift
class BooksCollectionAllBooksDataProvider: BaseBooksCollectionDataProvider {
override var title: String {
return "All Books"
}
override var datasource: [ObjectId] {
if let user = store.state.usersState.users[user] {
return user.allBooks
}
return []
}
override func loadData(paginationDelegate: PaginationDelegate) {
store.dispatchQueue(UserRequests.FetchAllBooks(user: user,
limit: paginationDelegate.limit,
offset: paginationDelegate.offset,
useCache: false))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment