middlestone
A simple middleware for HTTP requests. Utilises fetch
under the hood (fully polyfilled).
Example use of Result API:
Using redux-saga
:
// services/some-api.js ; const API_GET = 200: 'https://jsonplaceholder.typicode.com/posts/1' 404: 'https://jsonplaceholder.typicode.com/bad-route'; const client = ; ;
//sagas/effects.jsconst delay = ;
// sagas/index.js;;; { const Err Ok = ; ifOk const postBody = Ok; // safely unwrap result ; else ; ; }