Results for “Context & shared state”
Small, practical examples. Search by task or narrow things down below.
Protect a shared counter
Protect a shared counter using a complete Go program with explicit sample inputs.
Go✓ 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
Represent an enabled state
Arduino / C: Represent an enabled state on an Uno with the Serial Monitor set to 9600 baud.
Arduino / C✓ Tested
Reset child state by changing its key
Reset child state by changing its key with a small React component and explicit browser behavior.
React✓ Tested
Reset controlled form state
Reset controlled form state with a small React component and explicit browser behavior.
React✓ Tested
Reset reducer state explicitly
Reset reducer state explicitly with a small React component and explicit browser behavior.
React✓ Tested
Reset state to a caller-provided initial value
Reset state to a caller-provided initial value with a small React component and explicit browser behavior.
React✓ Tested
Restore the index state recorded in a stash
Git: Apply with index restores which changes were staged as well as their file contents.
Git✓ Tested