Skip to content

Commit

Permalink
refactor(vue)!: nest tx options (#390)
Browse files Browse the repository at this point in the history
  • Loading branch information
tien authored Dec 8, 2024
1 parent 87f21cb commit a723319
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/strong-vans-bake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@reactive-dot/vue": minor
---

BREAKING: nested tx options to avoid possible property clash.
11 changes: 5 additions & 6 deletions packages/vue/src/composables/use-mutation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,10 @@ export function useMutation<
);

return useAsyncAction(
(
submitOptions?: TxOptions<ReturnType<TAction>> & {
signer: PolkadotSigner;
},
) => {
(submitOptions?: {
signer: PolkadotSigner;
txOptions: TxOptions<ReturnType<TAction>>;
}) => {
const signer =
submitOptions?.signer ?? toValue(options?.signer) ?? injectedSigner;

Expand All @@ -94,7 +93,7 @@ export function useMutation<
return transaction
.signSubmitAndWatch(
signer,
submitOptions ?? toValue(options?.txOptions),
submitOptions?.txOptions ?? toValue(options?.txOptions),
)
.pipe(
tap(
Expand Down

0 comments on commit a723319

Please sign in to comment.