Results for “state”
Small, practical examples. Search by task or narrow things down below.
Append to an array without mutating state
Append to an array without mutating state with a small React component and explicit browser behavior.
React✓ Tested
Apply classes from explicit Boolean state
jQuery: The second toggleClass argument applies a known state consistently.
jQuery✓ Tested
Assign a bit from a Boolean state
Arduino / C: bitWrite accepts a bit position and a zero or nonzero value.
Arduino / C✓ Tested
Calculate derived state during rendering
Calculate derived state during rendering with a small React component and explicit browser behavior.
React✓ Tested
Capture state in a closure
Capture state in a closure using a complete Go program with explicit sample inputs.
Go✓ Tested
Centralize state changes in a reducer
Centralize state changes in a reducer with a small React component and explicit browser behavior.
React✓ Tested
Distinguish current state from initial markup
jQuery: prop reads the live checked state; attr reads the original checked attribute.
jQuery✓ Tested
Expose a disclosure button’s expanded state
HTML: Keep aria-expanded synchronized with the controlled panel’s hidden state.
HTML✓ 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 a disclosure’s expanded state
Expose a disclosure’s expanded state with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Expose service state through a read-only signal
Expose service state through a read-only signal with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Find a named container in the created state
Docker / Compose: Combine name and status filters to narrow a listing.
Docker / Compose✓ Tested