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
SQL ServerBulk changes & set operations

Find rows shared by two query results

SQL Server: INTERSECT compares complete selected rows and removes duplicates.

SQL Server✓ Tested
PostgresBulk changes & set operations

Find rows shared by two query results

Postgres: INTERSECT compares complete selected rows and removes duplicates.

Postgres✓ Tested
SQLiteBulk changes & set operations

Find rows shared by two query results

SQLite: INTERSECT compares complete selected rows and removes duplicates.

SQLite✓ Tested
RustErrors & optional values

Add context to a parsing failure

Add context to a parsing failure in a complete Rust program using the standard library.

Rust✓ Tested
ReactGetting Started

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
jQueryCollections & styling

Apply classes from explicit Boolean state

jQuery: The second toggleClass argument applies a known state consistently.

jQuery✓ Tested
Arduino / CBinary values & packets

Assign a bit from a Boolean state

Arduino / C: bitWrite accepts a bit position and a zero or nonzero value.

Arduino / C✓ Tested
PythonFunctions & error handling

Avoid a shared mutable default argument

Python: Create a fresh list inside the function when the optional argument is omitted.

Python✓ Tested
ReactState & reducers

Calculate derived state during rendering

Calculate derived state during rendering with a small React component and explicit browser behavior.

React✓ Tested
GoFunctions & types

Capture state in a closure

Capture state in a closure using a complete Go program with explicit sample inputs.

Go✓ Tested
ReactState & reducers

Centralize state changes in a reducer

Centralize state changes in a reducer with a small React component and explicit browser behavior.

React✓ Tested
AngularServices & dependency injection

Derive totals inside a shared service

Derive totals inside a shared service with a standalone Angular component and explicit browser behavior.

Angular✓ Tested