Skip to content

Commit 0a87a46

Browse files
committed
Update README
1 parent 744086b commit 0a87a46

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

README.md

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ The global export of library now exposes :
3030
JsonClient, // client class
3131
Middlewares, // class that stores middleware stacks for every hook
3232
MiddlewareStack, // class that stores middlewares
33-
middlewares, //TODO: export default middlewares
33+
middlewares, // a bunch of middleware installing functions
3434
}
3535
```
3636

@@ -56,19 +56,19 @@ Therefore, this library enables you to ease your job at emitting POST requests.
5656

5757

5858

59-
`$json.post :: (url: string, data: any) -> Promise`
59+
`$json.post :: (url: string, data: object|undefined) -> Promise`
6060

61-
`$json.post :: (url: string, data: any, options: object) -> Promise`
61+
`$json.post :: (url: string, data: object|undefined, options: object) -> Promise`
6262

6363
```
6464
$json.post :: (
6565
url: string,
66-
data: any,
67-
cache: $json.enums.Cache,
68-
credentials: $json.enums.Credentials,
69-
mode: $json.enums.Mode,
70-
redirect: $json.enums.Redirect,
71-
referrer: $json.enums.Referrer
66+
data: object|undefined,
67+
cache: JsonClient.enums.Cache,
68+
credentials: JsonClient.enums.Credentials,
69+
mode: JsonClient.enums.Mode,
70+
redirect: JsonClient.enums.Redirect,
71+
referrer: JsonClient.enums.Referrer
7272
) -> Promise
7373
```
7474

@@ -265,9 +265,8 @@ $json.middlewares.GET
265265

266266
## Dependencies
267267

268-
There is only one dependency :
269-
270-
* [fetchJSON](https://www.npmjs.com/package/fetch_json) : Used in developpement as the GET request provider (I'm the one that needs it, you don't have to put it in your dependencies)
268+
There is only two dependencies :
269+
* `sequency` which is used internally to process arrays of data more efficiently (you don't have to do anything about it)
271270

272271
* The Fetch API or `fetch` : As part of the Fetch API, `fetch` allows to emit HTTP requests. This library is heavily based around this function and therefore requires it, modern browsers implement it but there are also a lot of polyfills out there, here are two of them :
273272

@@ -282,9 +281,11 @@ There is only one dependency :
282281
import fetchPonyfill from "fetch-ponyfill"
283282
const { fetch, Request, Response, Headers } = fetchPonyfill();
284283
global.fetch = fetch
284+
```
285285
```
286286

287287

288+
```
288289
289290
* [whatwg-fetch](https://www.npmjs.com/package/whatwg-fetch) : For old browsers
290291
@@ -298,7 +299,7 @@ There is only one dependency :
298299
299300
Dropping :
300301
301-
* dependency on `fetchJSON`
302+
* dependency on `fetchJSON`
302303
* support for method overriding/spoofing (no more `$json.method`)
303304
304305
@@ -307,6 +308,8 @@ Globally exposed variable for the browser is now `jsonclient` (i.e. `window.$jso
307308
308309
Now exposing a middleware system under `$json.middlewares`.
309310
311+
Moved `$json.enums` to be a static property of `JsonClient`, i.e. `JsonClient.enums`.
312+
310313
### v2.1.0
311314
312315
Updated `fetchJSON` to use its latest version (v2.2.0)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@voltra/json",
3-
"version": "2.1.0",
3+
"version": "3.0.0",
44
"description": "a JavaScript HTTP client specialized for JSON communications, based upon the Fetch API",
55
"main": "build-babel/jsonclient.js",
66
"scripts": {

0 commit comments

Comments
 (0)