convex-helpers
Advanced tools
Comparing version
@@ -22,3 +22,3 @@ /** | ||
import { EmptyObject, BetterOmit } from "../index.js"; | ||
export type UseStorage<T> = (key: string, initialValue: T) => readonly [T, (value: T) => void]; | ||
export type UseStorage<T> = (key: string, initialValue: T) => readonly [T, (value: T) => void] | [T, (value: T) => void, () => void]; | ||
export type RefreshSessionFn = (beforeUpdate?: (newSessionId: SessionId) => any | Promise<any>) => Promise<SessionId>; | ||
@@ -25,0 +25,0 @@ type SessionFunction<T extends "query" | "mutation" | "action", Args extends any = any> = FunctionReference<T, "public", { |
{ | ||
"name": "convex-helpers", | ||
"version": "0.1.28", | ||
"version": "0.1.29-alpha.0", | ||
"description": "A collection of useful code to complement the official convex package.", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -33,3 +33,3 @@ "use client"; | ||
initialValue: T | ||
) => readonly [T, (value: T) => void]; | ||
) => readonly [T, (value: T) => void] | [T, (value: T) => void, () => void]; | ||
@@ -47,3 +47,3 @@ export type RefreshSessionFn = ( | ||
T extends "query" | "mutation" | "action", | ||
Args extends any = any | ||
Args extends any = any, | ||
> = FunctionReference<T, "public", { sessionId: SessionId } & Args, any>; | ||
@@ -120,3 +120,3 @@ | ||
export function useSessionMutation< | ||
Mutation extends SessionFunction<"mutation"> | ||
Mutation extends SessionFunction<"mutation">, | ||
>(name: Mutation) { | ||
@@ -123,0 +123,0 @@ const [sessionId] = useSessionId(); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
432575
0.04%