Skip to content

highpoint-tech/bs-js-fetch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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` */ )

About

BuckleScript bindings for HighPoint Fetch Library

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages