Results for “Context & shared state”
Small, practical examples. Search by task or narrow things down below.
Read the kind of command being invoked
PowerShell: CommandType distinguishes cmdlets from functions, aliases, and external applications.
PowerShell✓ Tested
Refresh a cached data attribute deliberately
jQuery: After the first read, data caches a parsed value; removeData forces a new attribute read.
jQuery✓ Tested
Reject insertion when a fixed queue is full
Arduino / C: Track a count separately from circular read and write positions.
Arduino / C✓ Tested
Remove an item with filter
Remove an item with filter with a small React component and explicit browser behavior.
React✓ Tested
Remove an optional attribute entirely
jQuery: removeAttr removes the attribute instead of setting a string that might still activate it.
jQuery✓ Tested
Replace a signal’s value explicitly
Replace a signal’s value explicitly with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Replace an object signal immutably
Replace an object signal immutably with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Restore a form’s original default values
jQuery: Call the native reset method through the underlying form element.
jQuery✓ Tested
Restore an environment value after temporary use
PowerShell: Use finally so temporary process configuration does not leak to subsequent work; remove the entry when it was originally absent.
PowerShell✓ Tested
Restore the working location after an operation
PowerShell: Push-Location and Pop-Location manage a directory stack; finally ensures restoration.
PowerShell✓ Tested
Send a value through a channel
Send a value through a channel in a complete Rust program using the standard library.
Rust✓ Tested
Serialize successful controls for a URL-encoded request
jQuery: serialize includes named enabled controls and checked checkboxes.
jQuery✓ Tested