Skip to content

Commit

Permalink
📝 Fixed readme usage layout
Browse files Browse the repository at this point in the history
  • Loading branch information
elbywan committed Oct 9, 2017
1 parent 47b4630 commit 7f8ea0f
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,30 +201,30 @@ var wretch = require("wretch")
```javascript
wretch(url, options)

/* The "request" part. */
__
|.[helper method(s)]()
| // [ Optional ]
| // A set of helper methods to set the default options, set accept header, change the current url ...
|.[body type]()
| // [ Optional ]
| // Serialize an object to json or FormData formats and sets the body & header field if needed
|.[http method]()
| // [ Required ]
| // Performs the get/put/post/delete/patch request
‾‾
/* The "request" chain. */

.[helper method(s)]()
// [ Optional ]
// A set of helper methods to set the default options, set accept header, change the current url ...
.[body type]()
// [ Optional ]
// Serialize an object to json or FormData formats and sets the body & header field if needed
.[http method]()
// [ Required, ends the request chain]
// Performs the get/put/post/delete/patch request

/* Fetch is called at this time. */
/* The request is sent, and from this point on you can chain catchers and call a response type handler. */

/* The "response" part. */
__
|.[catcher(s)]()
| // [ Optional ]
| // You can chain error handlers here
|.[response type]()
| // [ Required ]
| // Specify the data type you need, which will be parsed and handed to you
‾‾
/* The "response" chain. */

.[catcher(s)]()
// [ Optional ]
// You can chain error handlers here
.[response type]()
// [ Required, ends the response chain]
// Specify the data type you need, which will be parsed and handed to you

/* From this point wretch returns a standard Promise, so you can continue chaining actions afterwards. */

.then(/* ... */)
Expand Down

0 comments on commit 7f8ea0f

Please sign in to comment.