FIND YOUR NEXT FEW LINES

Results for “Event control”

Small, practical examples. Search by task or narrow things down below.

166 snippets foundClear filters
C#Types & reliable control flow

Provide a fallback for a nullable value

C#: The null-coalescing operator supplies a default only when the left side is null.

C#✓ Tested
ReactAccessibility & events

Read a data attribute from the current target

Read a data attribute from the current target with a small React component and explicit browser behavior.

React✓ Tested
AngularEvents & DOM interaction

Read a DOM element through a viewChild signal

Read a DOM element through a viewChild signal with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
AngularLists & control flow

Remove a list item by identifier

Remove a list item by identifier with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
AngularLists & control flow

Render groups with nested loops

Render groups with nested loops with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
ReactAccessibility & events

Render untrusted-looking input as literal text

Render untrusted-looking input as literal text with a small React component and explicit browser behavior.

React✓ Tested
JavaRecords & reliable control flow

Return a value from a switch expression

Java: Use an exhaustive switch expression with a fallback for other input values.

Java✓ Tested
C#Types & reliable control flow

Return multiple named values from a method

C#: Named value tuples give lightweight field names without a separate class.

C#✓ Tested
JavaRecords & reliable control flow

Run a task on an executor and close it

Java: Java 21 ExecutorService supports try-with-resources to shut down after submitted work.

Java✓ Tested
JavaRecords & reliable control flow

Run cleanup after a handled exception

Java: A finally block executes whether the protected operation succeeds or fails.

Java✓ Tested
AngularLists & control flow

Sort a derived copy of a collection

Sort a derived copy of a collection with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
AngularEvents & DOM interaction

Stop a nested click from reaching its parent

Stop a nested click from reaching its parent with a standalone Angular component and explicit browser behavior.

Angular✓ Tested