Results for “Event control”
Small, practical examples. Search by task or narrow things down below.
Style the first and last list items
Style the first and last list items with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Track a selected record by its identifier
Track a selected record by its identifier with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Transform an asynchronous result
Java: Chain thenApply and join a CompletableFuture to retrieve the completed value.
Java✓ Tested
Transform an optional value
Java: Use Optional.map and orElse to transform a possibly absent result.
Java✓ Tested
Update a shared counter atomically
Java: AtomicInteger provides an indivisible increment operation for a shared counter.
Java✓ Tested
Use a switch expression to classify a value
C#: Relational patterns express a small ordered range classification.
C#✓ 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
Validate a required argument
Java: Use requireNonNull with a useful message at an API boundary.
Java✓ Tested
Validate an argument at a method boundary
C#: ThrowIfNegative gives callers an explicit argument error for an invalid range.
C#✓ Tested
Write a generic first-or-fallback helper
C#: Constrain a generic helper through its input shape and return an explicit caller-supplied fallback.
C#✓ Tested
Allow several selected options
HTML: A multiple select exposes each selected option as a value with the same control name.
HTML✓ Tested
Blink without blocking the loop
Use elapsed millis time instead of delay for a repeating action.
millis✓ Tested