FIND YOUR NEXT FEW LINES

Results for “State & reducers”

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

453 snippets foundClear filters
AngularGetting Started

Toggle a CSS class from component state

Toggle a CSS class from component state with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
jQueryDOM & classes

Toggle a state class

Toggle a CSS class in a jQuery click handler.

jQuery✓ Tested
Arduino / CDigital signals & interrupts

Toggle an output using an explicit software state

Arduino / C: Keep the intended output state in a Boolean variable.

Arduino / C✓ 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
ReactContext & shared state

Update state shared through context

Update state shared through context 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
C++Tasks & synchronization

Wait for shared state with a condition variable

C++: Use a predicate so spurious wakeups cannot allow the worker to continue before the state is ready.

C++✓ Tested