Merge pull request #2492 from 0xProject/fix/instant/constant-polling
[Fix] Instant call destroyAsync on unmount
This commit is contained in:
		@@ -466,7 +466,8 @@ export class SwapQuoter {
 | 
			
		||||
     * Destroys any subscriptions or connections.
 | 
			
		||||
     */
 | 
			
		||||
    public async destroyAsync(): Promise<void> {
 | 
			
		||||
        return this.orderbook.destroyAsync();
 | 
			
		||||
        await this._protocolFeeUtils.destroyAsync();
 | 
			
		||||
        await this.orderbook.destroyAsync();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
 
 | 
			
		||||
@@ -153,6 +153,9 @@ export class ZeroExInstantProvider extends React.PureComponent<ZeroExInstantProv
 | 
			
		||||
        if (this._swapQuoteHeartbeat) {
 | 
			
		||||
            this._swapQuoteHeartbeat.stop();
 | 
			
		||||
        }
 | 
			
		||||
        const state = this._store.getState();
 | 
			
		||||
        // tslint:disable-next-line: no-floating-promises
 | 
			
		||||
        state.providerState.swapQuoter.destroyAsync();
 | 
			
		||||
    }
 | 
			
		||||
    public render(): React.ReactNode {
 | 
			
		||||
        return (
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user