All Projects → reasonml-community → Bs Fetch

reasonml-community / Bs Fetch

Licence: mit
Fetch bindings for BuckleScript

Programming Languages

ocaml
1615 projects
bucklescript
41 projects

Projects that are alternatives of or similar to Bs Fetch

Bs Loader
📻 Bucklescript loader for Webpack and Jest
Stars: ✭ 146 (-24.74%)
Mutual labels:  reasonml
Rebolt
Framework for developing apps in ReasonML
Stars: ✭ 161 (-17.01%)
Mutual labels:  reasonml
Graphql Ppx
GraphQL language primitives for ReScript/ReasonML written in ReasonML
Stars: ✭ 185 (-4.64%)
Mutual labels:  reasonml
React Infinite Scroll Hook
A simple hook to create infinite scroll list components
Stars: ✭ 151 (-22.16%)
Mutual labels:  fetch
React Hooks Fetch
React custom hooks for data fetching with Suspense
Stars: ✭ 154 (-20.62%)
Mutual labels:  fetch
Add Reason
✨🐢 Dead simple tool for seamlessly integrating ReasonML into existing JavaScript projects.
Stars: ✭ 168 (-13.4%)
Mutual labels:  reasonml
Reason Apollo Hooks
Deprecated in favor of https://github.com/reasonml-community/graphql-ppx
Stars: ✭ 140 (-27.84%)
Mutual labels:  reasonml
Zl Fetch
A library that makes the Fetch API a breeze
Stars: ✭ 186 (-4.12%)
Mutual labels:  fetch
Mande
600 bytes convenient and modern wrapper around fetch
Stars: ✭ 154 (-20.62%)
Mutual labels:  fetch
Philip2
An Elm to OCaml compiler
Stars: ✭ 182 (-6.19%)
Mutual labels:  reasonml
Bs Blabla
BuckleScript `[@bs.blabla]` attributes explained with examples
Stars: ✭ 151 (-22.16%)
Mutual labels:  reasonml
React Fetch Component
React component to declaratively fetch data
Stars: ✭ 153 (-21.13%)
Mutual labels:  fetch
Sinn
a blog based on of react,webpack3,dva,redux,material-ui,fetch,generator,markdown,nodejs,koa2,mongoose,docker,shell,and async/await 基于react+koa2技术栈的个人开源博客系统
Stars: ✭ 175 (-9.79%)
Mutual labels:  fetch
Use Http
🐶 React hook for making isomorphic http requests
Stars: ✭ 2,066 (+964.95%)
Mutual labels:  fetch
Bs Material Ui
ReScript bindings for material-ui
Stars: ✭ 185 (-4.64%)
Mutual labels:  reasonml
Reason Expo
ReasonML bindings for Expo
Stars: ✭ 140 (-27.84%)
Mutual labels:  reasonml
Fullstack Reason
A demo project that shows a fullstack ReasonML/OCaml app–native binary + webapp
Stars: ✭ 164 (-15.46%)
Mutual labels:  reasonml
Wretch
A tiny wrapper built around fetch with an intuitive syntax. 🍬
Stars: ✭ 2,285 (+1077.84%)
Mutual labels:  fetch
Reasonml Cheat Sheet
A cheat sheet for ReasonML -- WIP
Stars: ✭ 187 (-3.61%)
Mutual labels:  reasonml
Fetchql
GraphQL client with Fetch
Stars: ✭ 178 (-8.25%)
Mutual labels:  fetch

bs-fetch

Low-level bindings to fetch for BuckleScript.

npm Issues Last Commit Size

bs-fetch is intended as a thin layer atop the JS API, upon which more high-level and idiomatic libraries can be made. Once such a library has been established, these bindings will likely be refactored to be even thinner.

Example

Js.Promise.(
  Fetch.fetch("/api/hellos/1")
  |> then_(Fetch.Response.text)
  |> then_(text => print_endline(text) |> resolve)
);

Installation

npm install --save bs-fetch

Then add bs-fetch to bs-dependencies in your bsconfig.json:

{
  ...
  "bs-dependencies": ["bs-fetch"]
}

Usage

See usage examples in ocaml_examples.ml and reason_examples.re. The source is a single file!

Node.js polyfill

fetch is a Web API that isn't available out-of-the-box in Node.js, and will therefore need to be polyfilled. isomorphic-fetch one such polyfill that seems to work well. Just install it via npm and add [%raw "require('isomorphic-fetch')"] to the top of your main file, but be aware that there are some subtle differences and even parts that are missing entirely.

Changes

0.6.2

  • Added FormData bindings

0.6.0

  • Bugfix: Response._type was generating _type instead of type
  • Breaking: Rename Response._type to Response.type_ to follow the name mangling convention trends

0.5.2

  • Added AbortController

0.5.0

  • Fixed Headers.append and Headers.delete. They were missing the return type.

0.4.0

  • Bumped bs-platform to 5.0.4 to stop compiler from complaining.

0.3.0

  • Added HeadersInit.makeWithDict so as to be able to make headers in OCaml too
  • Require bs-platform >= 3.0.0 due to internal dependency on Js.boolean that has now been removed

0.2.0

  • Rename Bs_fetch module to Fetch. Bs_fetch is kept around as an alias for backwards compatibility, but should be considered deprecated.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].