Results for “State & reducers”
Small, practical examples. Search by task or narrow things down below.
Keep loop state by avoiding a pipeline subshell
Bash Scripts: Redirect input into a while loop so updates to a counter remain in the current shell.
Bash Scripts✓ Tested
Keep separate state for separate hook calls
Keep separate state for separate hook calls with a small React component and explicit browser behavior.
React✓ Tested
Mark a nonurgent state update as a transition
Mark a nonurgent state update as a transition with a small React component and explicit browser behavior.
React✓ Tested
Memoize a sorted copy of state
Memoize a sorted copy of state with a small React component and explicit browser behavior.
React✓ Tested
Preserve input state when tracked records reorder
Preserve input state when tracked records reorder with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Preserve item state while reordering by key
Preserve item state while reordering by key with a small React component and explicit browser behavior.
React✓ Tested
Protect shared mutable state with a mutex
Protect shared mutable state with a mutex in a complete Rust program using the standard library.
Rust✓ Tested
Provide an @empty list state
Provide an @empty list state with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Publish updated state through a BehaviorSubject
Publish updated state through a BehaviorSubject with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Render a helpful empty state
Render a helpful empty state with a small React component and explicit browser behavior.
React✓ Tested
Represent a finite set of states
Java: Use an enum to prevent arbitrary strings from representing application states.
Java✓ Tested
Represent a small set of named states
C: An enum gives symbolic names to integer state values.
C✓ Tested