Browse Source

Release fetch resource

Ben Hsieh 8 years ago
parent
commit
664a91c246
2 changed files with 13 additions and 0 deletions
  1. 8
    0
      src/class/StatefulPromise.js
  2. 5
    0
      src/index.js

+ 8
- 0
src/class/StatefulPromise.js View File

1
+// Copyright 2016 wkh237@github. All rights reserved.
2
+// Use of this source code is governed by a MIT-style license that can be
3
+// found in the LICENSE file.
4
+// @flow
5
+
6
+export default class StatefulPromise extends Promise {
7
+
8
+}

+ 5
- 0
src/index.js View File

16
   RNFetchBlobStream,
16
   RNFetchBlobStream,
17
   RNFetchBlobResponseInfo
17
   RNFetchBlobResponseInfo
18
 } from './types'
18
 } from './types'
19
+import StatefulPromise from './class/StatefulPromise.js'
19
 import fs from './fs'
20
 import fs from './fs'
20
 import getUUID from './utils/uuid'
21
 import getUUID from './utils/uuid'
21
 import base64 from 'base-64'
22
 import base64 from 'base-64'
167
       subscription.remove()
168
       subscription.remove()
168
       subscriptionUpload.remove()
169
       subscriptionUpload.remove()
169
       stateEvent.remove()
170
       stateEvent.remove()
171
+      delete promise['progress']
172
+      delete promise['uploadProgress']
173
+      delete promise['stateChange']
174
+      delete promise['cancel']
170
 
175
 
171
       if(err)
176
       if(err)
172
         reject(new Error(err, respInfo))
177
         reject(new Error(err, respInfo))