Results for “Context & shared state”
Small, practical examples. Search by task or narrow things down below.
Distinguish current state from initial markup
jQuery: prop reads the live checked state; attr reads the original checked attribute.
jQuery✓ Tested
Embed a struct for shared fields
Embed a struct for shared fields using a complete Go program with explicit sample inputs.
Go✓ Tested
Escape text for an HTML context
C#: HtmlEncode converts markup delimiters in plain text before rendering it as HTML content.
C#✓ Tested
Exclude files from the build context
Docker / Compose: A dockerignore file prevents selected local files from being copied.
Docker / Compose✓ 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
Find shared members of two sets
JavaScript: Filter one set through the other set’s membership test.
JavaScript✓ Tested
Find shared members of two sets
TypeScript: Filter one set through the other set’s membership test.
TypeScript✓ Tested
Find shared set members
Java: Copy a set before retainAll when the original must remain unchanged.
Java✓ Tested