Skip to content

Instantly share code, notes, and snippets.

@aaronshaf
Created December 23, 2017 02:47
Show Gist options
  • Save aaronshaf/8d4cb4fa0476a926648269f1b82990db to your computer and use it in GitHub Desktop.
Save aaronshaf/8d4cb4fa0476a926648269f1b82990db to your computer and use it in GitHub Desktop.
let getIt = () =>
Js.Promise.(
Fetch.fetch(url)
|> then_(Fetch.Response.json)
|> then_((json) => Js.Json.decodeObject(json) |> resolve)
|> then_((obj) => Js.log(obj /* how can I get obj.message? */) |> resolve)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment