Closed hftf closed 10 years ago
How about a new method that takes care of everything (list_overlaps
and replaceState
) at the end of a “transaction”?
Sounds reasonable. Make State
use private functions to do individual operations (changing the state of one or more inputs, updating the URL,...) and expose public functions which use these individual operations and afterwards call the private "transaction finalizer".
We'll need a bit of refactoring to make sure the callers can do everything in one transaction. For example, reset_all
in coords.js
currently calls State
functions multiple times, ideally we want to reduce that to just one transaction call.
:+1:
It comes down to adding this snippet in the right place:
Problem is where exactly this should go. You can do it in
setState
, but then you're doing too much work when a whole menu is rotated (rotateStates
) or when loading state from the URL (setAll
). Ideally, you want to call it at most once per trigger...