Support Promise API
Breaking change
-
Support the Promise API
-
Deprecated
prefix
option andcallback
option which has been replaced by Promise API
- new Jsonp({
+jsonp({
url: 'http://localhost',
// global function named `${jsonpCallback}` will be invoked when JSONP response
jsonpCallback: 'jsonp',
timeout: 5000,
// eg. ?customCallbackParams=...
callbackParams: 'customCallbackParams',
urlParams: {
// eg. ?key0=0&key1=1...
key0: 0,
key1: 1
}
- prefix: 'prefixOfCallback'
- callback: ()=> {...}
})
+ .then(res => res)