Results for “Signals & state”
Small, practical examples. Search by task or narrow things down below.
Update several classifications in one statement
SQL: A CASE expression computes the new value for each row covered by the update predicate.
SQL✓ Tested
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
Update several classifications in one statement
Postgres: A CASE expression computes the new value for each row covered by the update predicate.
Postgres✓ Tested
Update several classifications in one statement
SQLite: A CASE expression computes the new value for each row covered by the update predicate.
SQLite✓ Tested
Update state from its previous value
Update state from its previous value with a small React component and explicit browser behavior.
React✓ Tested
Update state shared through context
Update state shared through context with a small React component and explicit browser behavior.
React✓ Tested
Use named states for a controller
Arduino / C: An enum makes state transitions easier to read than unexplained numbers.
Arduino / C✓ Tested
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
Advance an index around a fixed collection
Arduino / C: Modulo wraps a bounded nonnegative index to zero.
Arduino / C✓ Tested
Check native form validity before proceeding
jQuery: Use the native checkValidity API from the selected form.
jQuery✓ Tested
Choose labels from a language context
Choose labels from a language context with a small React component and explicit browser behavior.
React✓ Tested
Collect repeated form field names
jQuery: serializeArray preserves multiple values as name-value records.
jQuery✓ Tested