Reactive APIs
    Preparing search index...
    DispatchType: "async" | "sync"

    Controls when callbacks are executed.

    Type Declaration

    • "async"

      Callbacks are invoked in a new task (similar to setTimeout(cb, 0)). This is the default behavior.

      As a consequence, synchronous code and resolved promise executions that immediately follow the original change (which triggered the callback) will have been executed already when the callback runs.

    • "sync"

      Callbacks are invoked synchronously, either immediately or after the current batch().

      For example:

      emit(myObject.click, { x: 1, y: 2 });; // sync callbacks run here
      

      or

      batch(() => {
      // ...
      mySignal.value = newValue;
      }); // Or here, when the outermost batch is complete.