How to use the tstl/utility/Pair.Pair function in tstl

To help you get started, we’ve selected a few tstl 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 samchon / tgrid / src / protocols / workers / SharedWorkerConnector.ts View on Github external
else
                    err = new DomainError("Closing.");

                reject(err);
                return;
            }

            //----
            // CONNECTOR
            //----
            try
            {
                // PREPARE MEMBERS
                this.state_ = SharedWorkerConnector.State.CONNECTING;
                this.args_ = args;
                this.connector_ = new Pair(resolve, reject);

                // DO CONNECT
                let worker = new SharedWorker(jsFile);
                
                this.port_ = worker.port;
                this.port_.onmessage = this._Handle_message.bind(this);
                this.port_.start();
            }
            catch (exp)
            {
                this.state_ = SharedWorkerConnector.State.NONE;
                reject(exp);
            }
        });
    }