Skip to content

Commit

Permalink
fix typo in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ezzarghili committed Mar 1, 2019
1 parent 88bcf74 commit 055c185
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Minimalistic xhr javascript library `experimental`

The best optimal approach is to add the minified inline to avoid extra http calls

```javascript
```html
<script>
((e,t,r)=>{e.xorq={},t=((t,o,s,a)=>((s=new XMLHttpRequest).open(o,t,!0),(r=e.xorq.timeout)&&(s.timeout=r),s.onreadystatechange=s.then=((e,t,r,o,n)=>{if(e&&e instanceof Function&&(a=[,e,t]),a&&4==s.readyState){if(r=a[0|s.status/200]){n=s.responseText;try{o=JSON.parse(n)}catch(e){o=n}r(o,s)}}else t&&t({error:"error accured"},s)}),s)),methods=["GET","POST"],methods.map(r=>{e.xorq[r.toLowerCase()]=((o,s,a={},n=e.xorq.headers)=>(xhr=t(o,r),n||(n={}),a=Object.assign({},n,a),Object.keys(a).forEach(e=>{xhr.setRequestHeader(e,a[e])}),xhr.send(s),xhr))})})(window);
</script>
Expand Down

0 comments on commit 055c185

Please sign in to comment.