Results for “default”
Small, practical examples. Search by task or narrow things down below.
Display a slice of paginated data
Display a slice of paginated data with a small React component and explicit browser behavior.
React✓ Tested
Display the result of an asynchronous action
Display the result of an asynchronous action with a small React component and explicit browser behavior.
React✓ Tested
Encapsulate increment and reset operations
Encapsulate increment and reset operations with a small React component and explicit browser behavior.
React✓ Tested
Expose a disclosure’s expanded state
Expose a disclosure’s expanded state with a small React component and explicit browser behavior.
React✓ Tested
Expose immutable collection operations
Expose immutable collection operations with a small React component and explicit browser behavior.
React✓ Tested
Extract reusable toggle behavior
Extract reusable toggle behavior with a small React component and explicit browser behavior.
React✓ Tested
Filter a list by a search term
Filter a list by a search term with a small React component and explicit browser behavior.
React✓ Tested
Find a matching item with a fallback
C#: Use the FirstOrDefault overload with an explicit default value.
C#✓ Tested
Find commits by message
Search commit subjects and bodies for a phrase.
log✓ Tested
Find the first matching stream value
Java: Use findFirst and an explicit default for an empty result.
Java✓ Tested
Find the first matching value with a fallback
Python: Pass a generator and default to next to avoid building an intermediate list.
Python✓ Tested
Flatten a single nesting level
JavaScript: flat defaults to a depth of one and creates a new array.
JavaScript✓ Tested