Ignore the observe event when an action runs on an observable

Viewed 99

I have an observable x.

@observable
double x

Now i have an action which mutates the x

@action
double mutatex(double z){
  x=z;
}

Now whenever i call the action, the respective Observer widget gets rebuilt. Is there anyway i can prevent the rebuild of the observer widget upon calling the action. i.e. action method gets called and the mutation happens but the respective observer ignores the action.

1 Answers

That would kinda go against the whole idea of using the Observer, Observable and Action.

You could remove the @action or @observable annotation, but if the UI is rebuilt for a different reason (like screen resize, background and resume, etc) the new result will likely show.

Related