Skip to content

Commit b382c10

Browse files
committed
cleanup
1 parent ce639d0 commit b382c10

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

docs/atom-vue/index.ts.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,17 @@ Added in v1.0.0
5959
**Signature**
6060
6161
```ts
62-
export declare const useAtomSet: <R, W>(atom: () => Atom.Writable<R, W>) => (_: W) => void
62+
export declare const useAtomSet: <R, W, Mode extends "value" | "promise" | "promiseExit" = never>(
63+
atom: () => Atom.Writable<R, W>,
64+
options?: { readonly mode?: ([R] extends [Result.Result<any, any>] ? Mode : "value") | undefined }
65+
) => "promise" extends Mode
66+
? (value: W, options?: { readonly signal?: AbortSignal | undefined } | undefined) => Promise<Result.Result.Success<R>>
67+
: "promiseExit" extends Mode
68+
? (
69+
value: W,
70+
options?: { readonly signal?: AbortSignal | undefined } | undefined
71+
) => Promise<Exit.Exit<Result.Result.Success<R>, Result.Result.Failure<R>>>
72+
: (value: W | ((value: R) => W)) => void
6373
```
6474
6575
Added in v1.0.0

sample/vue/src/components/HelloWorld.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const result = useAtomValue(() => {
1515
return Atom.refreshOnWindowFocus(TestClient.query("Get", req.value, { reactivityKeys: ["Get"]}))
1616
})
1717
18-
const set = useAtomSet(() => TestClient.mutation("Set"), { mode: "promiseExit"})
18+
const set = useAtomSet(() => TestClient.mutation("Set"), { mode: "promiseExit" })
1919
2020
const intervalEnabled = ref(false)
2121

0 commit comments

Comments
 (0)