FIND YOUR NEXT FEW LINES

Results for “Context & shared state”

Small, practical examples. Search by task or narrow things down below.

509 snippets foundClear filters
JavaRecords & reliable control flow

Update a shared counter atomically

Java: AtomicInteger provides an indivisible increment operation for a shared counter.

Java✓ Tested
ReactGetting Started

Update an object without mutating state

Update an object without mutating state with a small React component and explicit browser behavior.

React✓ Tested
SQLBulk changes & set operations

Update several classifications in one statement

SQL: A CASE expression computes the new value for each row covered by the update predicate.

SQL✓ Tested
SQL ServerBulk changes & set operations

Update several classifications in one statement

SQL Server: A CASE expression computes the new value for each row covered by the update predicate.

SQL Server✓ Tested
PostgresBulk changes & set operations

Update several classifications in one statement

Postgres: A CASE expression computes the new value for each row covered by the update predicate.

Postgres✓ Tested
SQLiteBulk changes & set operations

Update several classifications in one statement

SQLite: A CASE expression computes the new value for each row covered by the update predicate.

SQLite✓ Tested
ReactGetting Started

Update state from its previous value

Update state from its previous value with a small React component and explicit browser behavior.

React✓ Tested
Arduino / CArrays & embedded state

Use named states for a controller

Arduino / C: An enum makes state transitions easier to read than unexplained numbers.

Arduino / C✓ Tested
jQueryInsertion & wrapping

Wrap a collection in one shared parent

jQuery: wrapAll places all selected elements inside one wrapper.

jQuery✓ Tested
GoErrors & validation

Wrap an error with context

Wrap an error with context using a complete Go program with explicit sample inputs.

Go✓ Tested
Arduino / CArrays & embedded state

Advance an index around a fixed collection

Arduino / C: Modulo wraps a bounded nonnegative index to zero.

Arduino / C✓ Tested
AngularSignals & state

Append to an array signal immutably

Append to an array signal immutably with a standalone Angular component and explicit browser behavior.

Angular✓ Tested