@highpoint/bs-js-fetch

0.7.0 • Public • Published

bs-js-fetch

BuckleScript bindings for HighPoint's js-fetch.

Pre-requisites

Installation

yarn add @highpoint/bs-js-fetch 

In your bsconfig.json, include "@highpoint/bs-js-fetch" in the bs-dependencies.

Usage

open Fetch;

json(~url="http://google.com", ())
|> Js.Promise.then_(result => /* do something with `result` */ );

let abortController = AbortController.make();

postForm(
  ~url="schedule-builder",
  ~options=Options.(make(~body=Body.make("key1=value1&key2=value2", ~signal=(abortController |> AbortController.signal), ()))),
  ()
)
|> Js.Promise.then_(result => /* do something with `result` */ )

postJSON(
  ~url="message-center",
  ~options=Options.(make(~body=Body.makeWithUrlSearchParams(urlSearchParams), ())),
  ()
)
|> Js.Promise.then_(result => /* do something with `result` */ )

Package Sidebar

Install

npm i @highpoint/bs-js-fetch

Weekly Downloads

13

Version

0.7.0

License

MIT

Unpacked Size

5.82 kB

Total Files

9

Last publish

Collaborators

  • gamalor
  • dustinneumann42
  • jkrehm
  • mciparelli
  • gjoneshpt