-
Notifications
You must be signed in to change notification settings - Fork 70
Open
Description
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...
convex-js/src/browser/simple_client.ts
Lines 185 to 190 in ab02ff0
| 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
convex-js/src/browser/simple_client.ts
Lines 214 to 225 in ab02ff0
| // 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, | |
| ); | |
| } |
Metadata
Metadata
Assignees
Labels
No labels