Browse Source

Release event listener after request is canceled

Ben Hsieh 8 years ago
parent
commit
219216dad1
1 changed files with 2 additions and 0 deletions
  1. 2
    0
      src/index.js

+ 2
- 0
src/index.js View File

161
   }
161
   }
162
   promise.cancel = (fn) => {
162
   promise.cancel = (fn) => {
163
     fn = fn || function(){}
163
     fn = fn || function(){}
164
+    subscription.remove()
165
+    subscriptionUpload.remove()
164
     RNFetchBlob.cancelRequest(taskId, fn)
166
     RNFetchBlob.cancelRequest(taskId, fn)
165
   }
167
   }
166
 
168