Skip to content

Instantly share code, notes, and snippets.

View lgrahl's full-sized avatar
🦁

Lenny lgrahl

🦁
View GitHub Profile
@lgrahl
lgrahl / lock.ts
Created October 28, 2022 12:52
TS/JS Async Lock
/**
* A TypeScript async lock implemented with promise chaining.
*
* Usage:
*
* this._lock.with(async () => {
* await doThing1();
* await doThing2(a);
* });
*/
@lgrahl
lgrahl / vite-client-ext.d.ts
Last active December 6, 2021 08:16
Vite Worker Plugin
declare module '*?wrkr' {
export const url: string;
export const create: {
(): Worker;
};
}
declare module '*?srvcwrkr' {
export const url: string;
export const register: {
(

Keybase proof

I hereby claim:

  • I am lgrahl on github.
  • I am lgrahl (https://keybase.io/lgrahl) on keybase.
  • I have a public key whose fingerprint is 3FDB 1486 8A2B 36D6 38F3 C495 F98F BED1 0482 ABA6

To claim this, I am signing this object: