Skip to content

Commit

Permalink
Fix refresh query atom type
Browse files Browse the repository at this point in the history
  • Loading branch information
rithik-b committed Apr 9, 2024
1 parent 4d820e5 commit d0ee68f
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/createTRPCJotai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ type QueryResolver<TProcedure extends AnyProcedure, TClient> = {
getInput: AsyncValueOrGetter<ProcedureArgs<TProcedure['_def']>[0]>,
getOptions?: ValueOrGetter<ProcedureArgs<TProcedure['_def']>[1]>,
getClient?: (get: Getter) => TClient,
): Atom<Promise<inferProcedureOutput<TProcedure>>>;
): WritableAtom<Promise<inferProcedureOutput<TProcedure>>, [], void>;
(
getInput: AsyncValueOrGetter<
ProcedureArgs<TProcedure['_def']>[0] | typeof DISABLED
Expand All @@ -135,7 +135,11 @@ type QueryResolver<TProcedure extends AnyProcedure, TClient> = {
ProcedureArgs<TProcedure['_def']>[1] & { disabledOutput?: undefined }
>,
getClient?: (get: Getter) => TClient,
): Atom<Promise<inferProcedureOutput<TProcedure> | undefined>>;
): WritableAtom<
Promise<inferProcedureOutput<TProcedure> | undefined>,
[],
void
>;
<DisabledOutput>(
getInput: AsyncValueOrGetter<
ProcedureArgs<TProcedure['_def']>[0] | typeof DISABLED
Expand All @@ -144,7 +148,11 @@ type QueryResolver<TProcedure extends AnyProcedure, TClient> = {
ProcedureArgs<TProcedure['_def']>[1] & { disabledOutput: DisabledOutput }
>,
getClient?: (get: Getter) => TClient,
): Atom<Promise<inferProcedureOutput<TProcedure> | DisabledOutput>>;
): WritableAtom<
Promise<inferProcedureOutput<TProcedure> | DisabledOutput>,
[],
void
>;
};

type MutationResolver<TProcedure extends AnyProcedure, TClient> = (
Expand Down

0 comments on commit d0ee68f

Please sign in to comment.