@arcote.tech/arc-host 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { type ArcContextAny } from "@arcote.tech/arc";
2
- export declare function hostLiveModel<C extends ArcContextAny>(context: C, options: {
2
+ export declare function hostLiveModel<C extends ArcContextAny>(contextPromise: Promise<C>, options: {
3
3
  db: string;
4
4
  version: number;
5
5
  }): void;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAItD,wBAAgB,aAAa,CAAC,CAAC,SAAS,aAAa,EACnD,OAAO,EAAE,CAAC,EACV,OAAO,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,QAIzC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAItD,wBAAgB,aAAa,CAAC,CAAC,SAAS,aAAa,EACnD,cAAc,EAAE,OAAO,CAAC,CAAC,CAAC,EAC1B,OAAO,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,QAMzC"}
package/dist/index.js CHANGED
@@ -6721,9 +6721,11 @@ var sqliteAdapterFactory = (dbName) => {
6721
6721
  };
6722
6722
 
6723
6723
  // index.ts
6724
- function hostLiveModel(context3, options) {
6724
+ function hostLiveModel(contextPromise, options) {
6725
6725
  const dbAdapterFactory = sqliteAdapterFactory(options.db);
6726
- rtcHostFactory(context3, dbAdapterFactory(context3))();
6726
+ contextPromise.then((context3) => {
6727
+ rtcHostFactory(context3, dbAdapterFactory(context3))();
6728
+ });
6727
6729
  }
6728
6730
  export {
6729
6731
  hostLiveModel
package/index.ts CHANGED
@@ -3,9 +3,11 @@ import { rtcHostFactory } from "./host";
3
3
  import { sqliteAdapterFactory } from "./sqliteAdapter";
4
4
 
5
5
  export function hostLiveModel<C extends ArcContextAny>(
6
- context: C,
6
+ contextPromise: Promise<C>,
7
7
  options: { db: string; version: number },
8
8
  ) {
9
9
  const dbAdapterFactory = sqliteAdapterFactory(options.db);
10
- rtcHostFactory(context, dbAdapterFactory(context))();
10
+ contextPromise.then((context) => {
11
+ rtcHostFactory(context, dbAdapterFactory(context))();
12
+ });
11
13
  }
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
7
- "version": "0.1.2",
7
+ "version": "0.1.3",
8
8
  "private": false,
9
9
  "author": "Przemysław Krasiński [arcote.tech]",
10
10
  "dependencies": {