How to cancel an update() in a Svelte store?

Svelte stores can be updated via the store.update() method.

store.update((currentValue) => {
  return currentValue + 1;
});

Is it possible to cancel an update in the update function itself?

For example, we may way want to introduce some logic to decides whether to trigger and update to the subscribers or not.

store.update((currentValue) => {
  // this doesn't work because it sets the value of the store to undefined
  if (currentValue >= 10) return;
  return currentValue + 1;
});

A solution is to decide beforehand if the store should be updated or not, but in more advanced use cases this can become cumbersome and even lead to duplication of code.

if (get(store) < 10) {
  store.update((currentValue) => {
    return currentValue + 1;
  });
}

Is there any other solution to this issue?