|
1 | 1 | /*eslint no-console: "off"*/ |
2 | 2 |
|
3 | | -import Promise from 'es6-promise'; |
4 | | - |
5 | 3 | export default class MULTI_DATA_MODULE { |
6 | 4 |
|
7 | 5 | constructor(options={}){ |
@@ -34,7 +32,7 @@ export default class MULTI_DATA_MODULE { |
34 | 32 |
|
35 | 33 | // Data obj. |
36 | 34 | this.DataFix = []; |
37 | | - this.DataList = {}; |
| 35 | + this.DataList = []; |
38 | 36 |
|
39 | 37 | // Set callback functions. |
40 | 38 | if(!options.on){ |
@@ -84,7 +82,7 @@ export default class MULTI_DATA_MODULE { |
84 | 82 | window.callback = (response)=>{ |
85 | 83 | resolve(response); |
86 | 84 | }; |
87 | | - setTimeout(()=>{ reject('error'); }, this.Config.fetch_timeout); |
| 85 | + setTimeout(()=>{ reject('error: timeout'); }, this.Config.fetch_timeout); |
88 | 86 |
|
89 | 87 | } else { |
90 | 88 | reject('error:not found data.'); |
@@ -181,7 +179,7 @@ export default class MULTI_DATA_MODULE { |
181 | 179 | xhr.open('GET', _url, true); |
182 | 180 | xhr.send(null); |
183 | 181 |
|
184 | | - setTimeout(()=>{ reject('error'); }, this.Config.fetch_timeout); |
| 182 | + setTimeout(()=>{ reject('error: timeout'); }, this.Config.fetch_timeout); |
185 | 183 |
|
186 | 184 | } else { |
187 | 185 | reject('error:not found data.'); |
@@ -301,7 +299,7 @@ export default class MULTI_DATA_MODULE { |
301 | 299 | xhr.responseType = 'document'; |
302 | 300 | xhr.send(null); |
303 | 301 |
|
304 | | - setTimeout(()=>{ reject('error'); }, this.Config.fetch_timeout); |
| 302 | + setTimeout(()=>{ reject('error: timeout'); }, this.Config.fetch_timeout); |
305 | 303 | }); |
306 | 304 |
|
307 | 305 | promise |
|
0 commit comments