effect-atom-svelte 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -334,11 +334,17 @@ export function useAtomSet(input, options) {
334
334
  throw new TypeError(`useAtomSet's ${mode} mode cannot wait for Atom.Reset; reset with a value mode setter`);
335
335
  }
336
336
  const atom = getAtom();
337
- // An already aborted signal rejects without writing, as fetch does (JND-25).
338
- if (!writeOptions?.signal?.aborted) {
337
+ // An already aborted signal settles as interrupted without writing, as fetch does (JND-25). It
338
+ // skips the wait too: Effect checks the signal only after a first run, which would return a
339
+ // result the atom already holds from an earlier call.
340
+ let exit;
341
+ if (writeOptions?.signal?.aborted) {
342
+ exit = Exit.interrupt();
343
+ }
344
+ else {
339
345
  registry.set(atom, value);
346
+ exit = await awaitResult(registry, atom, { suspendOnWaiting: true }, writeOptions?.signal);
340
347
  }
341
- const exit = await awaitResult(registry, atom, { suspendOnWaiting: true }, writeOptions?.signal);
342
348
  return mode === "promiseExit" ? exit : valueOrThrow(exit);
343
349
  };
344
350
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "effect-atom-svelte",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Community-built Svelte 5 bindings for Effect Atom (not affiliated with the Effect team)",
5
5
  "keywords": [
6
6
  "effect",