@powersync/react-native 1.32.0 → 1.33.0
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.js +3 -7
- package/dist/index.js.map +1 -1
- package/lib/sync/stream/ReactNativeStreamingSyncImplementation.d.ts +1 -2
- package/lib/sync/stream/ReactNativeStreamingSyncImplementation.js +2 -6
- package/lib/sync/stream/ReactNativeStreamingSyncImplementation.js.map +1 -1
- package/package.json +4 -5
- package/src/sync/stream/ReactNativeStreamingSyncImplementation.ts +3 -7
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { AbstractStreamingSyncImplementation, AbstractStreamingSyncImplementationOptions, LockOptions, LockType } from '@powersync/common';
|
|
2
|
-
import { Mutex } from 'async-mutex';
|
|
1
|
+
import { AbstractStreamingSyncImplementation, AbstractStreamingSyncImplementationOptions, LockOptions, LockType, Mutex } from '@powersync/common';
|
|
3
2
|
export declare class ReactNativeStreamingSyncImplementation extends AbstractStreamingSyncImplementation {
|
|
4
3
|
locks: Map<LockType, Mutex>;
|
|
5
4
|
constructor(options: AbstractStreamingSyncImplementationOptions);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { AbstractStreamingSyncImplementation, LockType } from '@powersync/common';
|
|
2
|
-
import { Mutex } from 'async-mutex';
|
|
1
|
+
import { AbstractStreamingSyncImplementation, LockType, Mutex } from '@powersync/common';
|
|
3
2
|
/**
|
|
4
3
|
* Global locks which prevent multiple instances from syncing
|
|
5
4
|
* concurrently.
|
|
@@ -33,11 +32,8 @@ export class ReactNativeStreamingSyncImplementation extends AbstractStreamingSyn
|
|
|
33
32
|
throw new Error(`Lock type ${lockOptions.type} not found`);
|
|
34
33
|
}
|
|
35
34
|
return lock.runExclusive(async () => {
|
|
36
|
-
if (lockOptions.signal?.aborted) {
|
|
37
|
-
throw new Error('Aborted');
|
|
38
|
-
}
|
|
39
35
|
return lockOptions.callback();
|
|
40
|
-
});
|
|
36
|
+
}, lockOptions.signal);
|
|
41
37
|
}
|
|
42
38
|
}
|
|
43
39
|
//# sourceMappingURL=ReactNativeStreamingSyncImplementation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReactNativeStreamingSyncImplementation.js","sourceRoot":"","sources":["../../../src/sync/stream/ReactNativeStreamingSyncImplementation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mCAAmC,EAGnC,QAAQ,
|
|
1
|
+
{"version":3,"file":"ReactNativeStreamingSyncImplementation.js","sourceRoot":"","sources":["../../../src/sync/stream/ReactNativeStreamingSyncImplementation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mCAAmC,EAGnC,QAAQ,EACR,KAAK,EACN,MAAM,mBAAmB,CAAC;AAE3B;;;GAGG;AACH,MAAM,KAAK,GAAG,IAAI,GAAG,EAAgC,CAAC;AAEtD,MAAM,OAAO,sCAAuC,SAAQ,mCAAmC;IAC7F,KAAK,CAAuB;IAE5B,YAAY,OAAmD;QAC7D,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,SAAS,EAAE,CAAC;IACnB,CAAC;IAED;;OAEG;IACH,SAAS;QACP,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC;QACpC,IAAI,UAAU,IAAI,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;YACxC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,UAAU,CAAE,CAAC;YACpC,OAAO;QACT,CAAC;QAED,IAAI,CAAC,KAAK,GAAG,IAAI,GAAG,EAAmB,CAAC;QACxC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,KAAK,EAAE,CAAC,CAAC;QAC3C,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,KAAK,EAAE,CAAC,CAAC;QAE3C,IAAI,UAAU,EAAE,CAAC;YACf,KAAK,CAAC,GAAG,CAAC,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;QACpC,CAAC;IACH,CAAC;IAED,UAAU,CAAI,WAA2B;QACvC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QAC9C,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,MAAM,IAAI,KAAK,CAAC,aAAa,WAAW,CAAC,IAAI,YAAY,CAAC,CAAC;QAC7D,CAAC;QACD,OAAO,IAAI,CAAC,YAAY,CAAC,KAAK,IAAI,EAAE;YAClC,OAAO,WAAW,CAAC,QAAQ,EAAE,CAAC;QAChC,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACzB,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powersync/react-native",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.33.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org/",
|
|
6
6
|
"access": "public"
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"homepage": "https://docs.powersync.com/",
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"@journeyapps/react-native-quick-sqlite": "^2.5.1",
|
|
29
|
-
"@powersync/common": "^1.
|
|
29
|
+
"@powersync/common": "^1.50.0",
|
|
30
30
|
"react": "*",
|
|
31
31
|
"react-native": "*"
|
|
32
32
|
},
|
|
@@ -36,9 +36,8 @@
|
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"
|
|
40
|
-
"@powersync/
|
|
41
|
-
"@powersync/react": "1.9.0"
|
|
39
|
+
"@powersync/common": "1.50.0",
|
|
40
|
+
"@powersync/react": "1.9.1"
|
|
42
41
|
},
|
|
43
42
|
"devDependencies": {
|
|
44
43
|
"@craftzdog/react-native-buffer": "^6.0.5",
|
|
@@ -2,9 +2,9 @@ import {
|
|
|
2
2
|
AbstractStreamingSyncImplementation,
|
|
3
3
|
AbstractStreamingSyncImplementationOptions,
|
|
4
4
|
LockOptions,
|
|
5
|
-
LockType
|
|
5
|
+
LockType,
|
|
6
|
+
Mutex
|
|
6
7
|
} from '@powersync/common';
|
|
7
|
-
import { Mutex } from 'async-mutex';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Global locks which prevent multiple instances from syncing
|
|
@@ -45,11 +45,7 @@ export class ReactNativeStreamingSyncImplementation extends AbstractStreamingSyn
|
|
|
45
45
|
throw new Error(`Lock type ${lockOptions.type} not found`);
|
|
46
46
|
}
|
|
47
47
|
return lock.runExclusive(async () => {
|
|
48
|
-
if (lockOptions.signal?.aborted) {
|
|
49
|
-
throw new Error('Aborted');
|
|
50
|
-
}
|
|
51
|
-
|
|
52
48
|
return lockOptions.callback();
|
|
53
|
-
});
|
|
49
|
+
}, lockOptions.signal);
|
|
54
50
|
}
|
|
55
51
|
}
|