- feat(core): support direct call
xior.get/post..
similar toaxios.get/post..
API, no need create instance at first - fix(core):
DELETE
andOPTIONS
method's data option should be url encoded format likeGET
/HEAD
- feat: add
UMD
(Universal Module Definition) format bundle(now you can directly load xior in browser) - feat: add
VERSION
toxior
, now you can get current version of xior by:import xior from 'xior'; console.log(xior.VERSION)
- feat(new plugin): add
error-cache
plugin - feat(new plugin): add
dedupe
plugin - feat(new plugin): add
mock
plugin
Breaking Change:
- Type
before:
import xior from 'xior';
let instance: xior;
instance = xior.create();
Now:
import xior, { XiorInstance } from 'xior';
let instance: XiorInstance;
instance = xior.create();
- OPTIONS method
before:
import xior, { XiorInstance } from 'xior';
const instance = xior.create();
instance.options('/options_api_path', { text: 'this is data' }, { params: { a: 1 } });
now:
import xior, { XiorInstance } from 'xior';
const instance = xior.create();
instance.options('/options_api_path', { params: { a: 1, text: 'this is data' } });
What's Changed
- More plugins and umd support: support mock, error cache, requests dedupe plugins and UMD output by @suhaotian in #8
Full Changelog: v0.1.4...v0.2.1