This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { doWithLock, waitFor } from '../async-utils'; | |
describe('async-utils', () => { | |
describe('doWithLock', () => { | |
it('prevents multiple tasks from completing out of order', async () => { | |
const completed: string[] = []; | |
doWithLock('MY_LOCK', async () => { | |
await waitFor(0); | |
completed.push('A'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* TypeScript type definitions for Capacitor, adapted from the ones included | |
* in the @capacitor/core package (version 2.2.1). | |
* | |
* https://capacitor.ionicframework.com | |
* | |
* Useful if your project uses TypeScript namespaces ("internal modules") | |
* instead of the newer ES2015 module ("external modules") convention. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Normally, when using the await keyword to wait on a promise, if the promise is | |
* rejected then an exception will be thrown. This means that to handle a rejection | |
* you would need to try/catch all your await usages, which is inconvenient. | |
* | |
* This helper is meant to be used with the await keyword to wrap the promise | |
* so that it never throws an exception; it is guaranteed to resolve successfully. | |
* | |
* In the case of an error, it will be available in the resolved result object so |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Types for Braintree's Client SDK for Web. | |
* | |
* https://github.com/braintree/braintree-web | |
*/ | |
declare namespace BraintreeClientWeb { | |
interface BraintreeClientWebStatic { | |
api: API; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Variable Declarations -- | |
set title to "Chrome Development Launcher" | |
set startScript to "/Applications/Google\\ Chrome.app/Contents/MacOS/Google\\ Chrome --user-data-dir=/Users/$USER/Library/Application\\ Support/Google/ChromeDev" | |
set args to "--user-data-dir=/Users/$USER/Library/Application\\ Support/Google/ChromeDev --args --ignore-certificate-errors --disable-web-security --use-spdy=off --remote-debugging-port=9222" | |
set endScript to "> /dev/null 2>&1 &" |