How to use the @0x/utils.intervalUtils.clearAsyncExcludingInterval function in @0x/utils

To help you get started, we’ve selected a few @0x/utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github 0xProject / 0x-monorepo / packages / testnet-faucets / src / ts / dispatch_queue.ts View on Github external
public stop(): void {
        if (this._queueIntervalIdIfExists !== undefined) {
            intervalUtils.clearAsyncExcludingInterval(this._queueIntervalIdIfExists);
        }
    }
    private _start(): void {
github 0xProject / 0x-monorepo / packages / order-watcher / src / order_watcher / event_watcher.ts View on Github external
private _stopBlockAndLogStream(): void {
        if (_.isUndefined(this._blockAndLogStreamerIfExists)) {
            throw new Error(OrderWatcherError.SubscriptionNotFound);
        }
        this._blockAndLogStreamerIfExists.unsubscribeFromOnLogAdded(this._onLogAddedSubscriptionToken as string);
        this._blockAndLogStreamerIfExists.unsubscribeFromOnLogRemoved(this._onLogRemovedSubscriptionToken as string);
        intervalUtils.clearAsyncExcludingInterval(this._blockAndLogStreamIntervalIfExists as NodeJS.Timer);
        delete this._blockAndLogStreamerIfExists;
        delete this._blockAndLogStreamIntervalIfExists;
    }
    private async _onLogStateChangedAsync(
github 0xProject / 0x-monorepo / packages / order-watcher / src / order_watcher / order_watcher.ts View on Github external
public unsubscribe(): void {
        if (this._callbackIfExists === undefined || this._cleanupJobIntervalIdIfExists === undefined) {
            throw new Error(OrderWatcherError.SubscriptionNotFound);
        }
        this._balanceAndProxyAllowanceLazyStore.deleteAll();
        this._orderFilledCancelledLazyStore.deleteAll();
        delete this._callbackIfExists;
        this._eventWatcher.unsubscribe();
        this._expirationWatcher.unsubscribe();
        intervalUtils.clearAsyncExcludingInterval(this._cleanupJobIntervalIdIfExists);
    }
    /**
github 0xProject / 0x-monorepo / packages / web3-wrapper / src / web3_wrapper.ts View on Github external
(err: Error) => {
                        intervalUtils.clearAsyncExcludingInterval(intervalId);
                        reject(err);
                    },
                );
github 0xProject / 0x-monorepo / packages / website / ts / blockchain_watcher.ts View on Github external
private _stopEmittingUserBalanceState(): void {
        if (this._watchBalanceIntervalId !== undefined) {
            intervalUtils.clearAsyncExcludingInterval(this._watchBalanceIntervalId);
        }
    }
}
github 0xProject / 0x-monorepo / packages / website / ts / blockchain.ts View on Github external
private _stopWatchingGasPrice(): void {
        if (!_.isUndefined(this._watchGasPriceIntervalId)) {
            intervalUtils.clearAsyncExcludingInterval(this._watchGasPriceIntervalId);
        }
    }
    private async _resetOrInitializeAsync(