This function is called whenever a child component uses a Ditto instance through the useDitto hook
and the instance needs to be created.
The returned instance is cached under appPath, so configure it with
appPath as its persistence directory. That keeps the lazily loaded
instance resolvable by the same path through useDitto and the query hooks.
Type declaration
(appPath): Promise<Ditto>
Parameters
appPath: string
Path the instance is created for. Used both as a discriminator
for how to create the instance and as its cache key.
Returns Promise<Ditto>
Returns
A Ditto instance initialized on the given path, or null to skip creation.
This function is called whenever a child component uses a Ditto instance through the useDitto hook and the instance needs to be created.
The returned instance is cached under
appPath, so configure it withappPathas its persistence directory. That keeps the lazily loaded instance resolvable by the same path throughuseDittoand the query hooks.