When calling the onUpdate method of the ConvexClient I'd like to see an options parameter where I could specify lazy as true. When lazy is true the initial data fetch wouldn't happen.
When options: {lazy: true} is speficied here...
|
onUpdate<Query extends FunctionReference<"query">>( |
|
query: Query, |
|
args: FunctionArgs<Query>, |
|
callback: (result: FunctionReturnType<Query>) => unknown, |
|
onError?: (e: Error) => unknown, |
|
): Unsubscribe<Query["_returnType"]> { |
...this this code doesn't run
|
// If the callback is registered for a query with a result immediately available |
|
// schedule a fake transition to call the callback soon instead of waiting for |
|
// a new server update (which could take seconds or days). |
|
if ( |
|
this.queryResultReady(queryToken) && |
|
this.callNewListenersWithCurrentValuesTimer === undefined |
|
) { |
|
this.callNewListenersWithCurrentValuesTimer = setTimeout( |
|
() => this.callNewListenersWithCurrentValues(), |
|
0, |
|
); |
|
} |
When calling the
onUpdatemethod of theConvexClientI'd like to see anoptionsparameter where I could specifylazyastrue. When lazy istruethe initial data fetch wouldn't happen.When
options: {lazy: true}is speficied here...convex-js/src/browser/simple_client.ts
Lines 185 to 190 in ab02ff0
...this this code doesn't run
convex-js/src/browser/simple_client.ts
Lines 214 to 225 in ab02ff0