I have a component that I want to bind a different css class to based on a boolean value. I have the following in my component code:
bindCssClass(div, "open", this, "task.isOpen");
bindCssClass(div, "closed", this, 'task.isClosed');
Where isOpen / isClosed are defined as the following:
@observable bool isOpen = true;
get isClosed => !isOpen;
The question is, how can I get isClosed to be observable, but based on changes to isOpen? I'd like to know this case, but also for cases that are more complicated (e.g. a string that is derived from multiple components)
Additionally, is there a better way to use bindCss for such a simple case? Binding to '!task.isOpen' doesn't work, though it would be nice if it did.