Skip to content

Instantly share code, notes, and snippets.

@bobgodwinx
Created June 29, 2018 07:33
Show Gist options
  • Save bobgodwinx/9ecfa6d27c309399c50020e848521c46 to your computer and use it in GitHub Desktop.
Save bobgodwinx/9ecfa6d27c309399c50020e848521c46 to your computer and use it in GitHub Desktop.
OST05
/// `Model`
struct Model: ModelType {
let datasource: Observable<Resource>
init() {
let url = URL(string: "https://media.giphy.com/media/5z08WdHr0h9SHZekve/giphy.gif")!
let request = URLRequest(url: url)
self.datasource = URLSession.shared.rx
.response(request: request)
.share(replay: 1, scope: .forever)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment