Skip to content

Instantly share code, notes, and snippets.

@s4cha
Last active October 17, 2016 16:35
Show Gist options
  • Select an option

  • Save s4cha/046fe0cf812eefe6763fb79bc4232b84 to your computer and use it in GitHub Desktop.

Select an option

Save s4cha/046fe0cf812eefe6763fb79bc4232b84 to your computer and use it in GitHub Desktop.
import ws
import then
let api = Api()
struct Api {
private let ws = WS("http://jsonplaceholder.typicode.com")
func getUsers() -> Promise<[User]> { // We want [User] back!
return ws.get("/users")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment