Skip to content
This repository was archived by the owner on Mar 16, 2019. It is now read-only.

Commit 664a91c

Browse files
committed
Release fetch resource
1 parent 20b2c3c commit 664a91c

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/class/StatefulPromise.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
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+
}

src/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import type {
1616
RNFetchBlobStream,
1717
RNFetchBlobResponseInfo
1818
} from './types'
19+
import StatefulPromise from './class/StatefulPromise.js'
1920
import fs from './fs'
2021
import getUUID from './utils/uuid'
2122
import base64 from 'base-64'
@@ -167,6 +168,10 @@ function fetch(...args:any):Promise {
167168
subscription.remove()
168169
subscriptionUpload.remove()
169170
stateEvent.remove()
171+
delete promise['progress']
172+
delete promise['uploadProgress']
173+
delete promise['stateChange']
174+
delete promise['cancel']
170175

171176
if(err)
172177
reject(new Error(err, respInfo))

0 commit comments

Comments
 (0)