providePowerSync()
function providePowerSync(database, key): void
Provide the PowerSync client for all the caller component's descendants.
This function works on a hierarchical basis, meaning that the client provided by providePowerSync in a child component will override the client provided by createPowerSyncPlugin in a parent component.
If createPowerSyncPlugin was used to provide an app-wide client, all providePowerSync invocations are below it in the hierarchy.
If the key parameter is provided, the client will be provided under that key instead of the default PowerSync key.
Parameters
| Parameter | Type | Default value |
|---|---|---|
database | MaybeRef<AbstractPowerSyncDatabase> | undefined |
key | string | undefined |
Returns
void