js-bao-wss-client / initJsBao
Function: initJsBao()
initJsBao(
options):Promise<InitJsBaoResult>
Initializes the js-bao system with multi-document support. Sets up the database engine and prepares for document connections.
Every call returns its OWN instance: its own engine, model registry, connected documents, default-document mappings and subscribe() listeners. Nothing written through one instance is observable through another, and an instance can be torn down on its own through the returned destroy().
Model classes bind first-wins. A class handed to a second live initJsBao keeps routing to the instance it was bound to; the second call warns and carries on. Give each client its own model classes — as the schemaToml path already does — when they must be isolated.
Parameters
options
InitJsBaoOptions
Returns
Promise<InitJsBaoResult>