Results for “one-off”
Small, practical examples. Search by task or narrow things down below.
Update an object without mutating state
Update an object without mutating state with a small React component and explicit browser behavior.
React✓ Tested
Update repeatedly with a cleaned-up interval
Update repeatedly with a cleaned-up interval with a small React component and explicit browser behavior.
React✓ Tested
Update state from its previous value
Update state from its previous value with a small React component and explicit browser behavior.
React✓ Tested
Update state shared through context
Update state shared through context with a small React component and explicit browser behavior.
React✓ Tested
Use a context’s fallback value
Use a context’s fallback value with a small React component and explicit browser behavior.
React✓ Tested
Use a counted Bash loop
Bash Scripts: Use a counted Bash loop with a small standalone Bash program.
Bash Scripts✓ Tested
Use a fallback for an unset variable
Bash Scripts: Use a fallback for an unset variable with a small standalone Bash program.
Bash Scripts✓ Tested
Use native required-field validation
Use native required-field validation with a small React component and explicit browser behavior.
React✓ Tested
Use React 19’s provider shorthand
Use React 19’s provider shorthand with a small React component and explicit browser behavior.
React✓ Tested
Use the first fulfilled promise result
JavaScript: Promise.any ignores individual rejections until one input fulfills.
JavaScript✓ Tested
Use the first fulfilled promise result
TypeScript: Promise.any ignores individual rejections until one input fulfills.
TypeScript✓ Tested
Validate a field when focus leaves it
Validate a field when focus leaves it with a standalone Angular component and explicit browser behavior.
Angular✓ Tested