FIND YOUR NEXT FEW LINES
The snippet library.
Small, practical examples. Search by task or narrow things down below.
5 snippets foundClear filters
Await several independent results
Preserve input order while awaiting multiple promises.
Promise.all✓ Tested
Read a property with keyof
Keep the key and returned value tied to an object type.
keyof✓ Tested
Return typed data from an async function
Await a Promise and handle failures explicitly.
async✓ Tested
Select fields with the Pick utility type
Expose a smaller view of a larger object type.
Pick✓ Tested
Type an object update with Partial
Allow a caller to provide just the fields to change.
Partial✓ Tested