Given e.g. a class instance of some sort has a state (e.g. \'active\', \'inactive\', …). The instance also attaches a click event to e.g. a link but the event handler does somet
Which patterns are commonly in use to achieve this? Something like this Are you using a conditional in the event handler? Yes, see example Or are binding and unbinding handlers when the state changes? Nope, but it's a possibility. Am I missing some obvious other/better solution? I don't think so